To make container wrap elements with “float: left” (CSS)

Hey! How are you guys (girls?)?

I want to tell you a bit about ways to make container that can wrap included elements. Huh, you’ve already read about it in title? (:

I’m talking about next simple example:

<div style="background: red; padding: 5px;">
	<div style="background: green; float: left; padding: 5px;">First</div>
	<div style="background: yellow; float: left; padding: 5px;">Second</div>
</div>

Continue reading

Posted in CSS

Get timestamp in javascript

Sometimes you need operate timestamp, so there is how you can get it:

Date.prototype.getTimestamp = function() {
    return parseInt((this.getTime()-Date.UTC(1970,0,1))/1000);
}

after this you are able to use this method:

var d = new Date();
alert(d.getTimestamp());

and that’s it, cheers.

Update:
There is another way to get timestamp if you use jQuery:

alert($.now());

You can find detailed info about this method here.