I don’t understand this, if I have image slider and image preloader
jQuery.fn.awShowcase = function(options); //slider
$.fn.preloader = function(options); // preloader
They don’t work on the same page because the function is the same?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure what functions are the same because neither of them are.
When writing jQuery you can either refer to library with
jQueryor$because they set to each other internally. Thefnis pointing to jQuery’s namespace (think of it asobj.foo = {) In that example obj is$and foo isfn`.The last part is the actual plugin name. Both
awShowcaseandpreloaderare both assign to whats called anonymous functions. So when you call$('selector').awShowcase()or$('selector').preloader(), that anonymous function is called.Since
awShowcaseandpreloaderare not the same there should be no conflicts.