html - Manipulating div size using jquery -


i'm trying change size of div 99% of original size in jquery.

i'm using following code width:

var textwidth = $('.comment-holder').css('width'); 

this outputs value of 400px

so how can set width of div new value, 99% of original (of 400px)?

it easier use .width() rather .css('width') returns number. following should work:

var $e = $('.comment-holder'),     width = $e.width();  $e.width(width * 0.99); 

one problem this, override css widths such '90%' or '10em' , therefore stop automatic scaling , re-sizing.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -