jquery newbie question
jquery newbie question
- Started
- Last post
- 6 Responses
- leewilson78
Hi all,
I have my jquery is a file, I have several jqueries examples in this one file, do I add the following for each effect:
$(document).ready(function() {
or do I add it to the file once?
Thanks
- shitehawke0
once, put all your scripts into that function.
- leewilson780
cheers.
- shitehawke0
Such as:
jQuery(document).ready(function () {
jQuery(".gallery").jbgallery();
jQuery('#navigation').accordion...
});etc etc
- leewilson780
nice work, thanks.
- acescence0
it's easier to group it all together, but there's nothing technically stopping you from having multiple document ready functions, it will work either way.
- Stugoo0
only problem with putting it all in the one, is that if one function pops the whole list goes.
however its good for debuggage