The page with the left and right arrows appears in the picture JS code

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.