Archive for the ‘Code’ Category

Emmet

June 18th, 2013 No Comments

Not to long ago I was hearing about Zen Coding, and at the time I thought nothing of it. Why would I need a tool to help me write faster markup, HTML isn’t that hard…WRONG. I started to look into it again, and noticed that it had changed its name to Emmet, and it is amazing.

Why would you want to use such a tool? When you are building out sites and have to have tags that repeat over and over. Copy and paste seems fine, but it can sure get tedious. Enter Emmet.

Example markup, you would probably copy and paste all the li tags.

<ul>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
</ul>

With Emmet you can write a small amount of syntax you can produce that same markup:

ul>li*6

(more…)

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…)