I've added a new feature to my blog and I would like to share it with you. It's damn easy and very useful, if you care about design.
The reason I created this script is that the videos I embed has various sizes and enlarging them is a boring task, so let a small code do it:
function fixVideos()
{
// Maybe you should be more specific, than me
var videos = document.getElementsByTagName('embed');
var cwidth = 550; // The width you want to resize to
var ratio = 0;
for( i=0; i < videos.length; i++ )
{
ratio = videos[i].height / videos[i].width;
videos[i].width = cwidth;
videos[i].height = ratio * cwidth;
}
}
That's it.
1
Read more
All rights reserved, ©2008-2013 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1