好吧我有一个JavaScript翻转。我想在开始时选择clicked3图片,当我翻转或翻转其他图片时,clicked3将被取消选择。我的html中的图片ID是:clicked1,clicked2,clicked3,clicked4。我已经完成了这段代码,但它不起作用。看起来picture1翻转不起作用,picture3没有开始选择...任何帮助?javascript onmouseover和onmouseout问题
window.onload=function() {
var domClicked1=document.getElementById("clicked1");
var domClicked2=document.getElementById("clicked2");
var domClicked3=document.getElementById("clicked3");
var domClicked3=document.getElementById("clicked4");
clicked1.call(domClicked1);
clicked2.call(domClicked2);
clicked3.call(domClicked3);
clicked4.call(domClicked4);
domClicked1.onmouseover=handleOver1;
domClicked2.onmouseover=handleOver2;
domClicked3.onmouseover=handleOver3;
domClicked3.onmouseover=handleOver4;
domClicked1.onmouseout=handleOut1;
domClicked2.onmouseout=handleOut2;
domClicked3.onmouseout=handleOut3;
domClicked4.onmouseout=handleOut4;
}
function clicked1(){
this.style.backgroundPosition = "0px top";
}
function handleOver1() {
this.style.backgroundPosition = "-198px top";
}
function handleOut1() {
this.style.backgroundPosition = "-198px top";
}
function clicked3(){
this.style.backgroundPosition = "-198px top";
}
function handleOver3() {
this.style.backgroundPosition = "-198px top";
}
function handleOut3() {
this.style.backgroundPosition = "0px top";
}
任何特别的原因,为什么你不使用jQuery的呢? –
导致我工作的代理人想要这样..任何帮助? – alexkey89
我认为你应该说服你的经纪人这是一个坏主意。 –