Archive for May, 2013

jQuery CSS Multi-property getter

May 28th, 2013 No Comments

How many times have you wanted to get more than one property, say the margin or padding of an element with jQuery? After looking through the jQuery 1.9 release notes I saw that you can now use .css() to get many properties.

Now, apparently being able to set something like the padding short hand was something that you have be able to do for a while.


$('div').css('padding','1em 2em 3em 4em');

As of 1.9 you are now able to get multiple values:


var cssProps = $('div').css(['paddingTop','paddingRight','paddingBottom','paddingLeft']);

(more…)

Exploring the Web

May 27th, 2013 No Comments

alert("Hello world!");