Created
December 4, 2012 21:19
-
-
Save hitecherik-gist/4208794 to your computer and use it in GitHub Desktop.
JS: jQuery Plugin
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
| <!-- | |
| Created by Alexander Nielsen. alex@hitecherik.site11.com | |
| --> | |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="author" content="Alexander Nielsen" /> | |
| <title>Testing plugin...</title> | |
| </head> | |
| <body> | |
| <h1>Testing plugin...</h1> | |
| <!--body content here--> | |
| <!-- end html start scripts --> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js"></script> | |
| <script type="text/javascript" src="../test-plugin.js"></script> | |
| <script type="text/javascript"> | |
| $('h1').alertMeAboutSomething('Hello! This is a jQuery alert!'); | |
| </script> | |
| </body> | |
| </html> |
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
| (function( $ ){ | |
| $.fn.maxHeight = function() { | |
| var max = 0; | |
| this.each(function() { | |
| max = Math.max( max, $(this).height() ); | |
| }); | |
| return max; | |
| }; | |
| $.fn.alertMeAboutSomething = function(alertMessage) { | |
| alert(alertMessage); | |
| } | |
| })( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment