Determinare le dimensioni vere di un immagine con jquery

Un piccolo snippet

findImageSize($("img#myimg"));
function findImageSize(img){
	pLog("Finding image size");
	var tempWidth = img.width();
	var tempHeight = img.height();
	img.removeAttr("width").removeAttr("height").css("width","").css("height","");
	currentImageHeight = img.height();
	currentImageWidth = img.width();
	img.width(tempWidth).height(tempHeight);
}
Condividi:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • email
  • Google Bookmarks
  • LinkedIn
  • PDF
  • Reddit

Related posts:

  1. Documentazione di Jquery
  2. Flashget 1.73 Build 128
  3. Centrare un elemento sullo schermo con ausilio di JQuery
  4. Video divertenti
  5. Video da YouTubes
Nessun commento ancora

Lascia un commento

XHTML: Puoi usare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Switch to our mobile site