This example uses the OnMouseMove event for JavaScript. The OnMouseMove event occurs when the mouse pointer moves.
Grammar
Onmousemove= "Somejavascriptcode"
Somejavascriptcode is a required parameter. Specify the JavaScript to execute when the event occurs.
Below is the core code (complete code to view the source code in the effect page):
| The code is as follows |
Copy Code |
| <script Type= "Text/javascript" function Keleyiimgnext (bigimg) { var lefturl = "01.html"; var righturl = "03.html" ; var imgurl = Righturl; var width = bigimg.width; var height = bigimg.height; Bigimg.onmousedown = Bigimg.onmousemove = function () { if (Event.offsetx < WIDTH/2) { Imgurl = Lefturl; if (Imgurl!= "#") Bigimg.style.cursor = ' url (images/arr_left.cur), auto '; Else Bigimg.style.cursor = ' de Fault '; } else { Imgurl = Righturl if (imgurl!= ' # ') Bigimg.style.cursor = ' url (images/arr_right.cur), auto '; else Bigimg.style.cursor = ' default '; } } Bigimg.onmouseup = function () { if (imgurl!= ' # ') Top.location = Imgurl; } } </script> |