Simple and practical jQuery plug-in for animation with the mouse sliding over the Image Mask Layer to mask jquery

Source: Internet
Author: User

Simple and practical jQuery plug-in for animation with the mouse sliding over the Image Mask Layer to mask jquery

NsHover is a simple and practical jQuery plug-in that slides the mouse over the Image Mask Layer. This plug-in can be used to create animation effects of the mouse over an image or block-level element. It can be used to set the foreground color and background color of the mask layer, as well as to create a circular image.

Download Online Preview source code

Usage

The jQuery and ns. hover. min. js files need to be introduced when you move the mouse over the plug-in.

12 <script src="js/jquery.min.js"></script><script src="js/ns.hover.min.js"></script>               
Initialize the plug-in

After the DOM elements on the page are loaded, you only need to callnsHover()Method. You can use this method on the parent element, so all its child elements will be initialized.

1234567891011121314 <script>  $(container_class_or_id).nsHover({      scaling : false,      speed: 'normal',      rounded: 'normal',      bgcolor: '#ffffff',      bgopacity : 0.5,                  bgpic : 'imgs/lens.png',      bgsize : '50%',      bganim : 'fade',      shadow : false,      content: ''  });</script>     
Configuration parameters
Parameters Default Value Available Value Description
Scaling False False/0/0/0.0-1.0 Set the value 0.0-1.0 to make the element shrink when the mouse slides, or set it to 0/false to disable the zoom effect.
Speed Normal Normal/fast/slow Set the speed at which the mouse slides over a transitional animation.
Rounded Normal None (0%)/normal (5%)/circle (50%)/xx %/xx px This parameter is used to control the rounded corner of an element. You can set an element as a circle.
Bganim Fade Fade/scale/slide Type of background animation at the Mask Layer
Bgcolor '# Ffff'   Background Color of the Mask Layer
Bgopacity 0.5 0.0-1.0 Transparency of the background at the Mask Layer
Bgpic Imgs/lens.png Valid image path Position of the background image on the Mask Layer
Bgsize 25% 0%-100% Size of the background image of the Mask Layer
Shadow False True/false Set shadow effect?
Content '' Any valid html content Text displayed on the Mask Layer

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.