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

Link to comment
Share on other sites

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

 }
}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.