When the mouse moves to the picture, the large picture is displayed

Source: Internet
Author: User

Part of the HTML tag, for informational purposes only

<tr>
<td><input type= "checkbox" class= "CheckBox1"/></td>
<td>1002</td>
<td> Kitten </td>
<td></td>//pictures
<td>200</td>
<td><input type= "button" value= "Add"/></td>
</tr>

//write outside, hide display, position cue picture location

. clsimg{
Position:absolute;
border:1px solid #ccc;
width:200px;
height:200px;
Display:none;

}

JS Partial realization Function:

<script type= "Text/javascript" src= ". /jquery-1.8.3.js "></script>
<script type= "Text/javascript" >
$ (function () {

$ ("Table tr:nth-child (Odd)"). CSS ("Background", "#CCF"); Odd-even row discoloration

var x=5; var y=15;
$ ("Table tr td img"). MouseMove (function (e) {
$ ("#imgTip"). attr ("src", this.src). css ({"Top":(e.pagey+y) + "px", "left":(e.pagex+x) + "px"}). Show (600);
});

$ ("Table tr td img"). Mouseout (function () {
$ ("#imgTip"). Hide ();
});

/* check box Single Event */

$ ("#checkAll"). Click (function () {
if (this.checked) {
$ ("Table tr TD Input[type=checkbox]"). attr ("Checked", true);
}else
{
$ ("Table tr TD Input[type=checkbox]"). attr ("checked", false);
}
});



});
</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.