Jump to content

need some help with this java script please


alireza

Recommended Posts

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

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');
		}

 }
}

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.