alireza Posted December 30, 2009 Share Posted December 30, 2009 Im tryin to edit the java script for my categories on my website you can take a look at it www.vidoox.com its on the left side, the original script would open the sub categories under each category by just hovering on the category name but i played around with the script and i got it to here www.vidoox.com/js/general.js heres the original script: (untouched) www.vidoox.com/js/original.js what i wanted to get rid of was opening the sub categories by hovering, i want to make it that it opens the subcategories of each category by left clicking on the category and also left clicking again would close the subcategories , but it got messed up to this point that im stuck at. so if anyone could help me with the codings i would really appreciate it Quote Link to comment Share on other sites More sharing options...
Irresistable Posted December 30, 2009 Share Posted December 30, 2009 Are you trying to change it from a hover, to an onclick? If not, what are you actually doing? Quote Link to comment Share on other sites More sharing options...
alireza Posted December 30, 2009 Author Share Posted December 30, 2009 Are you trying to change it from a hover, to an onclick? If not, what are you actually doing? yes thats exactly wat i was tryin to do but failed. do u know how i can do that? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 30, 2009 Share Posted December 30, 2009 this should work function catlist() { $("#ul_categories li").unbind('click').click( function(){ var ul_subs = $(this).find('ul'); if(ul_subs.hasClass("hidden_li")) { ul_subs.removeClass(); ul_subs.addClass('visible_li') } else if(ul_subs.hasClass("visible_li")) { ul_subs.addClass("hidden_li"); ul_subs.removeClass('visible_li'); } } } Quote Link to comment Share on other sites More sharing options...
alireza Posted December 30, 2009 Author Share Posted December 30, 2009 this should work function catlist() { $("#ul_categories li").unbind('click').click( function(){ var ul_subs = $(this).find('ul'); if(ul_subs.hasClass("hidden_li")) { ul_subs.removeClass(); ul_subs.addClass('visible_li') } else if(ul_subs.hasClass("visible_li")) { ul_subs.addClass("hidden_li"); ul_subs.removeClass('visible_li'); } } } thankyou very much it worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.