jQuery Plugins
JavaScript is like lumber
•
•
•
•
•
•
•
•

Just add 2x4's™
Simple assembly, only straight cuts required
Makes any width you desire by the length of wood
Comfortable, ergonomic design
Strong and very durable
Made of maintenance-free structural resin
Lifetime manufacturer's warranty
Sand color

jQuery JavaScript Library
FREE!
•
•
•
•
•
•
•
•

Just add 2x4's™
Simple assembly, only straight cuts required
Makes any width you desire by the length of wood
Comfortable, ergonomic design
Strong and very durable
Made of maintenance-free structural resin
Lifetime manufacturer's warranty
Sand color

jQuery JavaScript Library
jQuery plugin
Refresher
Add jQuery to the <head>

<script	
  src="http://code.jquery.com/jquery.min.js"></script>
Refresher

$ (“.headline”).doSomething();
Refresher

$ (“.headline”).doSomething();
Refresher

$ (“.headline”).doSomething();
jQuery
Refresher

$ (“.headline”).doSomething();
jQuery
Refresher
CSS selector

$ (“.headline”).doSomething();
jQuery
Refresher
CSS selector

$ (“.headline”).doSomething();
jQuery
Refresher
CSS selector

$ (“.headline”).doSomething();
jQuery

jQuery command
For plugins, add code AFTER
jQuery
<script	
  src="http://code.jquery.com/jquery.min.js"></script>	
  
<script	
  src="jquery.fancybox.pack.js"></script>
For plugins, add code AFTER
jQuery
<script	
  src="http://code.jquery.com/jquery.min.js"></script>	
  
<script	
  src="jquery.fancybox.pack.js"></script>
Plugins create new jQuery
Methods build into jQuery proper
$("#mybox").fadeOut();	
  
!

$("#mybox").hide();	
  
!

$("#mybox").css("color",	
  "blue");
Plugins create new jQuery
Methods build into jQuery proper
$("#mybox").fadeOut();	
  
!

$("#mybox").hide();	
  
!

$("#mybox").css("color",	
  "blue");

New totally awesome jQuery method
$("#mybox").fancybox();
Fancy Box
Fancy Box
$(".fancybox").fancybox();

<a	
  href="image.jpg"	
  class="fancybox">Link	
  to	
  an	
  image</a>
jQuery Plugin Parameters

$(".fancybox").fancybox({});
jQuery Plugin Parameters

$(".fancybox").fancybox({});
curly brackets
jQuery Plugin Parameters
$(".fancybox").fancybox({	
  
!
!
!
!

});
jQuery Plugin Parameters
$(".fancybox").fancybox({	
  
!
!
!
!

});

Options go here
jQuery Plugin Parameters
$(".fancybox").fancybox({	
  
!

:"<h1>Hello	
  World</h1>",	
  
	
  	
  	
  content	
   	
   	
  	
  	
  	
  	
  
	
  	
  	
  width	
   :	
  400,	
  
	
  	
  
:	
  300,
	
  	
  	
  height	
  	
  	
  	
  	
  	
  	
  	
  
	
  
	
  	
  	
  	
  
!

});

Jquery plugins