Bonjour, j'utilise cette fontion pour créer des vignettes. Je récupère la largeur et la hauteur, j'applique une réduction (/2.5) et j'affiche.
Pas de problème avec FF et Chrome. IE ne capte pas.
1 2 3 4 5 6 7 8 9 10 11 12 13
|
$('.imgCatalogue').each(function() {
var mWidth = $(this).attr("width") ;
mWidth = Math.floor(mWidth/2.5) ;
var mHeight = $(this).attr("height") ;
mHeight = Math.floor(mHeight/2.5) ;
$(this).css("width",mWidth) ;
$(this).css("height",mHeight) ;
$(this).show() ;
} ) ; |
dans le html :
<img class="imgCatalogue" alt="Jamestown" src="/img_livres/31-JAMESTOWN/JAMESTOWN.jpg" />
Si vous avez une suggestion.
Partager