Tibor SzászAz élmény, ami számít

  • Nyitólap
  • Magamról
  • Projectek
  • Ajánlatkérés
  • Kapcsolat
  • RSS

2010 0314

Video maximizer script

Video maximizer script 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.



Kommentek


#01

lajkolom

Beküldte: bjmatt @ 2010-03-15 09:06

Új komment hozzáadása


Neved
E-mail
Your avatar
Weblapod
Komment

Eligazítás

Me myself and I
Imádok kódolni, különösesn a webre. Már 6 éve építem az online világot, kedvenc játékszereim:
JavaScript, PHP, XHTML, MySQL, Canvas, Flash
Switch to english

Témakörök

  • Coffee break
  • Design & stuff
  • Generative arts
  • Programming
  • User experience

Barátok

  • Kárpáti Róbert
  • Royaljerry
  • Bagi Zoltán
  • Pegazoo
  • Charles Alexander Deli
  • Bence Bangócs
  • Lunakid
  • Rapp design

Közösségi láz

  • Facebook
  • IWIW
  • TurulMeme

Címkék

javascript (14) php (6) mootools (5) iscaffold (4) codeigniter (4) tutorial (3) crud (3) structure-synth (2) renders (2) template (2) css (2) free (2) google (2) drupal (1) data-visualisation (1) resizing (1) canvas (1) soundcloud (1) wordpress (1) joomla (1) google-buzz (1) hack (1) script (1) rss (1) bermuda-triangle (1) interface (1) design, (1) transitions (1) easing (1) microsoft (1) windows8 (1) magyar (1) bugs (1) ie8 (1) experience (1) user (1) twitter (1) facebook (1) email (1) table (1) rc1 (1) nl2br (1) drag-and-drop (1) slideshow (1) wikipedia (1) dns (1) svg (1) experiment (1) firefox-extension (1) tagging (1) slimbox (1) bugfix (1) cfdg (1) lists (1) inspiration (1) data-uri (1) trick (1) forge (1) infovis (1) blackout (1) tabs (1) library (1) sitebuild (1) utf8 (1) class (1) ajax (1) konami-codes (1) open-source (1)




Minden jog fenntartva, ©2008-2012 - Készült CodeIgniter keretrendszerrel - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1