Monday, 30 September 2013

Unexpected identifier - how functions works

Unexpected identifier - how functions works

I'm trying to create a small simple jquery function but i can't understand
how to solvethis problem and can't find simple resources online where to
read how to create simple functions with two variables. My code is
jQuery(function ($) {
function infoText(menuitem,textinfo) {
menuitem.click(function(){
textinfo.fadeIn(300);
}
}
infoText('.come-realizzo','#come-realizzo');
infoText('.works','#works');
});
When i call the function i get this error:
Uncaught SyntaxError: Unexpected identifier on 9 line (
infoText('.come-realizzo','#come-realizzo'); ).
Thanks!

No comments:

Post a Comment