jquery-Mouse after displaying a large image and follow the mouse effect plug-in

Source: Internet
Author: User
By Zhangxinxu from http://www.zhangxinxu.com this address: http://www.zhangxinxu.com/wordpress/?p=281

Today after reading the "JavaScript language essence" This book, still have time, decided to write the jquery plugin to practice practiced hand, the effect is that the mouse moved to the thumbnail will show a larger image of the graph, and the large image follow the mouse movement, or move to the hint text, you can also display the picture. and the direction of the discriminant function, specifically, if the thumbnail in the left half of the page, the larger image is displayed on the right side of the mouse, if the thumbnail in the right half of the page, the preview of the large image on the left side of the mouse display.

See the following:

Image Zoom Preview Effect

brief description of how to use it: 1. The href attribute of the A tag is required, and the principle of this jquery plugin is that when the mouse is moved to the thumbnail (or linked text), a large HTML fragment containing an HREF-pointing path is loaded, which is absolutely positioned according to the position of the mouse. The result is an effect of moving the mouse over the thumbnail to show the large image. The address of the large map is the content of the href attribute of the A tag. For example: <a href= "xx.jpg" > Thumbnails </a> if this a tag contains a way to display a large image, the page displays the image of the "xx.jpg" that the href points to. 2. The method used is: Target selector. Preview (); For example, the above <a href= "xx.jpg" > Thumbnail </a> can use $ ("a"). Preview (); This code implements the mouse to "thumbnail" This text link shows the effect of xx.jpg this picture. 3. Only supports images in png,gif,jpg,bmp Four formats, you can modify the type of picture format supported by the regular expression extension of the plugin code.

Here is: demo Instance page | source File Download

Original article, reprint please indicate from Zhang Xin Xu-Xin space-Xin Life [http://www.zhangxinxu.com] This address: http://www.zhangxinxu.com/wordpress/?p=281

jquery-Mouse after displaying a large image and follow the mouse effect plug-in

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.