When you move the mouse over a small image, a large image is displayed-image prompt is displayed.

Source: Internet
Author: User

As it is required to display a large image when you move the mouse over a small image, I sent a jquery file to implement the result. Now I will share it with you:

First, download the jquery plug-in, create a tooltip. js file, and write the followingCode:

$ (Function (){
VaR x = 10;
Var y = 10;
$ ("A. tooltip"). Mouseover (function (e ){
This. mytitle = This. title;
This. Title = "";
VaR tooltip = "<Div id = 'tooltip '> <\/div>"; // create a div Element
$ ("Body"). append (tooltip); // append it to the document
$ ("# Tooltip ")
. CSS ({
"TOP": (E. Pagey + Y) + "PX ",
"Left": (E. pagex + x) + "PX"
}). Show ("fast"); // sets the X and Y coordinates and displays
}). Mouseout (function (){
This. Title = This. mytitle;
$ ("# Tooltip"). Remove (); // remove
}). Mousemove (function (e ){
$ ("# Tooltip ")
. CSS ({
"TOP": (E. Pagey + Y) + "PX ",
"Left": (E. pagex + x) + "PX"
});
});
})
//]>

 

Import two. js files on the page,

 

<SCRIPT src = "../javascripts/jquery-1.3.1.js" type = "text/JavaScript"> </SCRIPT>

<SCRIPT src = "../javascripts/tooltip. js" type = "text/JavaScript"> </SCRIPT>

Finally, you can bind the image to the mark:

<A href = "<% # databinder. eval (container. dataitem," imagebigurl ") %>" class = "tooltip"> // large image prompt
<Asp: imagebutton id = "image1" runat = "server" imageurl = '<% # databinder. eval (container. dataitem, "imagesmallurl") %> 'width = "50px" Height = "50px"/> </a>

 

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.