0

My code is for wordpress in noconflict mode
This code works only on double click not on a single click,any advice or guideness is welcomed.
I want to make it work on a single click.
Thank you in advance

$j=jQuery.noConflict();

 $j(document).ready(function() {

  $j("#icomenu").toggle(function(){
                $j("#menu").animate({left:"0px"});

            },
            function(){
                $j("#menu").animate({left:"-280px"});   

        }) 
    }) ;    
4
Contributors
4
Replies
6
Views
4 Years
Discussion Span
Last Post by dany12
0

That's kinda weird. Uhmm can you do this instead, without clearing the '$' variable in global.

(function($){
    $(document).ready(function() {
        $("#icomenu").toggle(
            function(){
                    $("#menu").animate({left:"0px"});
                },
            function(){
                    $("#menu").animate({left:"-280px"});   
                }) 
        });  
})(jQuery);

Are you using different jQuery versions?

Edited by gon1387

0

Ok first of all the code works but just on double click in wordpress but without wordpress this code works great,the second thing is that this is the way wordpress accepts to see the code ,furthermore wordpress adds the last version of jquery automaticly

wordpress jquery way

Thabk your for your help
But I think I will use addClass function and removeClass

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.