JS
OffsetxAnd
FirefoxCompatibility problems
FirefoxIt seems not supported
Offsetx
In the following code
OffsetxIn
FirefoxNext, can we use it easily?
Function upnext (bigimg ){
VaR lefturl = 'javascript: dplaypre ();';
VaR righturl = 'javascript: dplaynext ();';
VaR imgurl = righturl;
VaR width = bigimg. width;
VaR Height = bigimg. height;
Bigimg. onmousemove = function (EVT ){
EVT = EVT? EVT: (window. event? Window. Event: NULL );
If (EVT.Offsetx<Width/2 ){
Bigimg. style. cursor = 'url (/images/arr_left.cur), auto ';
Imgurl = lefturl;
}
Else {
Bigimg. style. cursor = 'url (/images/arr_right.cur), auto ';
Imgurl = righturl;
}
}
Bigimg. onmouseup = function (){
Top. Location = imgurl;
}
}
Nickname: xldgo time: 2010-08-27 14:26:15
-
JScript code
-
Function upnext (bigimg ){
VaR lefturl = 'javascript: dplaypre ();';
VaR righturl = 'javascript: dplaynext ();';
VaR imgurl = righturl;
VaR width = bigimg. width;
VaR Height = bigimg. height;
Bigimg. onmousemove = function (EVT ){
EVT = EVT? EVT: (window. event? Window. Event: NULL );
VaR FX = EVT.Offsetx| EVT. layerx;
If (FX <width/2 ){
Bigimg. style. cursor = 'url (/images/arr_left.cur), auto ';
Imgurl = lefturl;
}
Else {
Bigimg. style. cursor = 'url (/images/arr_right.cur), auto ';
Imgurl = righturl;
}
}
Bigimg. onmouseup = function (){
Top. Location = imgurl;
}
}
Reference: http://blog.csdn.net/IBM_hoojo/archive/2010/07/02/5708440.aspx