Friday, 21 November 2008

Learning Simple JQuery - Part 1.

This example demonstrates using an jQuery id selector on anchor tags to attach a click event. It also uses an id selector to attach the slideDown and slideUp JQuery functions to a html div element. Add following click handlers to page using console in FireBug
  • $("#lnkShowLoginBox").click(showLoginBox);
  • $("#lnkHideLoginBox").click(hideLoginBox);
function showLoginBox(e) {  
   console.log('in fn. showLoginBox');  
 function hideLoginBox(e) {  
   console.log('in fn. hideLoginBox');  
This simple JQuery example was taken from Stephen Walthers PDC 2008 talk.

No comments: