Last active
December 20, 2015 17:49
-
-
Save umidjons/6171162 to your computer and use it in GitHub Desktop.
jQuery plugin example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>jQuery Simple Plugin Example</title> | |
| </head> | |
| <body> | |
| <p class="wow">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem deleniti dolorem fugit maiores, nulla | |
| quam quos. | |
| Aperiam asperiores deserunt dicta itaque minima nobis quae quia sapiente sed voluptas. Nostrum, officia!</p> | |
| <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem deleniti dolorem fugit maiores, nulla quam quos. | |
| Aperiam asperiores deserunt dicta itaque minima nobis quae quia sapiente sed voluptas. Nostrum, officia!</p> | |
| <p class="wow">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem deleniti dolorem fugit maiores, nulla | |
| quam quos. | |
| Aperiam asperiores deserunt dicta itaque minima nobis quae quia sapiente sed voluptas. Nostrum, officia!</p> | |
| <script src="jquery-1.10.2.js"></script> | |
| <script type="text/javascript"> | |
| //--< HoverMe Plugin >-- | |
| jQuery.fn.HoverMe = function () | |
| { | |
| return this.each( function () | |
| { | |
| $( this ).hover( | |
| function () | |
| { | |
| $( this ).css( 'font-weight', 'bold' ); | |
| }, | |
| function () | |
| { | |
| $( this ).css( 'font-weight', 'normal' ); | |
| } | |
| ); | |
| } ); | |
| } | |
| //--< HoverMe Plugin />-- | |
| jQuery( document ).ready( function () | |
| { | |
| $( 'p.wow' ).HoverMe(); | |
| } ); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment