Add CSS property in jQuery

I need to set the CSS property in this script to go along with the animation, but I cannot do it right.

I need a div with the identifier "container" to set the CSS property when the click function is activated. I need to set overflow: hidden to #container .

Here is my script.

 $(function() { $(".folderContent").hide(); $(".signin").click(function(event) { var folderContent = $(".folderContent"); var folderContentShown = folderContent.css("display") != "none"; var clickedFolder = $(this); clickedFolder.parent("#signincontainer").after(folderContent); $("body").find("#container").not(clickedFolder).each(function() { if (!folderContentShown) $(this).not("#signincontainer").animate( { opacity: 0.50 }, "slow"); else $(this).animate({ opacity: 1.00 }, "slow"); }); //clickedFolder.animate({opacity: folderContentShown ? 1.00 : 0.70}, "fast"); folderContent.slideToggle(); event.preventDefault(); }); }); 
+7
source share
3 answers
 $('#container').css('overflow','hidden'); 

Have you tried this?

+21
source

You should just go to the jquery site and read it ... it will make more sense, and it is really straight forward.

http://api.jquery.com/css/

0
source

It is easy to use:

 $("p").css("color", "red"); 

You can follow this link: DEMO

0
source

All Articles