Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get default css value after jquery function

Tags:

jquery

Hi I have one questions For example :

$("#menu").click(function(){
    $("#left_panel, #main_footer").fadeToggle(200);
    $("#input_content").css({width:"100%"});
});

And I want after this function css get default property

like image 202
Val Do Avatar asked Jul 11 '14 14:07

Val Do


People also ask

How can check CSS property value in jQuery?

Get a CSS Property Value You can get the computed value of an element's CSS property by simply passing the property name as a parameter to the css() method. Here's the basic syntax: $(selector). css(“propertyName”);

What is the use of CSS () method in jQuery?

jQuery css() Method The css() method sets or returns one or more style properties for the selected elements. When used to return properties: This method returns the specified CSS property value of the FIRST matched element.

Can we change CSS properties values using JavaScript or jQuery?

It is possible to change the CSS property of an element by using a simple JavaScript API, but we try to complete this challenge using jQuery css() method. Syntax: $(). css(propertyname, value); $().

How can give multiple CSS properties in jQuery?

Apply multiple CSS properties using a single JQuery method CSS( {key1:val1, key2:val2....). You can apply as many properties as you like in a single call. Here you can pass key as property and val as its value as described above.


1 Answers

Default height value is auto, so you can set it back with:

$("#input_content").css({ width: 'auto' });
like image 140
Igor Avatar answered Sep 23 '22 10:09

Igor