2011-07-24 4 views

Répondre

1
var img = $('.anImage'), 
    offset = img.offset(); 

// position image absolutely in the same position to allow it to expand 
img.css({ 
     position: "absolute", 
     top: offset.top, 
     left: offset.left, 
     zIndex: 100 
    }) 
    // animate expansion 
    .animate({ 
     top: 0, 
     left: 0, 
     width: img.parent().width(), 
     height: img.parent().height() 
    }, "fast") 
    // fadeout 
    .fadeOut("fast"); 

La seule exigence est que vous laissez l'élément parent avec position: relative.

+0

cela fonctionne très bien, j'ai juste dû changer le fondu en .fadeTo ('lent', 0.3)! Merci beaucoup!!! –