Hey, I'm trying to make a jquery function call and pass some arguments with it in the form
$('#button').mouseenter(exampleFunction(arg1,arg2));
function exampleFunction(arg1,arg2)
The function works fine without creating such arguments.
$('#button').mouseenter(exampleFunction);
function exampleFunction;
but as soon as I add () so that the arguments in the function stop working.
like this:
$('#button').mouseenter(exampleFunction());
This seems to be some jquery syntax error on my part
here is the actual code
<script type="text/javascript">
$(document).ready(function() {
$('.section').mouseover(function(){
$('#nav2').fadeOut(0).animate({"height":"30px"}, 250);
});
$('#section1').hover(navSelect);
function navSelect(){
if ( $('.interior').is(':hidden')){
$('.subSection').fadeOut(250);
$('.interior').delay(250).fadeIn(250);
$('#selector').animate({"left":"0px"},250);
}}
$('#section2').mouseenter(function(){
if ( $('.exterior').is(':hidden')){
$('.subSection').fadeOut(250);
$('.exterior').delay(250).fadeIn(250);
$('#selector').animate({"left":"100px"},250);
}
});
$('#section3').mouseenter(function(){
if ( $('.view').is(':hidden')){
$('.subSection').fadeOut(250);
$('.view').delay(250).fadeIn(250);
$('#selector').animate({"left":"200px"},250);
}
});
});
</script>
source
share