This is one of the many example of what am I talking about. People
just "don't care" about instances of jQUery, because they can. I would
alwys tryu to minimise the number of jQuery instances, and make them
"obvious" vs "hidden" :
var $b = $(document.body) ,
// why would anyone ever do : $("html,body") ?
$l1 = $body.find("#link") ,
$l2 = $body.find("#link2"),
$bm = $body.find("#bottom"),
T = 5000 ;
$l1.click(function(){ $b.animate({scrollTop:$bm.offset().top},T);
});
$l2.click(function(){ $b.animate({scrollTop:0},T);
One body, one jQ.
find() used for speed.
Next "lesson" : event delegation ;o)
--DBJ
});
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en.