for example if I have
<img class="fr-box-wrapper"></img>
<img class="fr-box-wrapper"></img>
<img class="fr-box-wrapper"></img>
<img class="fr-box-wrapper"></img>
<img class="fr-box-wrapper"></img>
<img class="fr-box-wrapper"></img>
now I do a
this.magnify.click(function(e){
$('.fr-box-wrapper').attr({
"origwidth": $(this).width(), // this is wrong
"origheight": $(this).height() // this is wrong
}).css({
position: "fixed",
top: "0",
left: "0",
width: $(document).width(),
height: $(document).height(),
background: "white",
overflow: "auto"
});
});
how do I get width and height of each $('.fr-box-wrapper')
?
答案 0 :(得分:2)
$('.fr-box-wrapper').each(function(){
$(this).attr({
"origwidth": $(this).width(),
"origheight": $(this).height()
}).css({
position: "fixed",
top: "0",
left: "0",
width: $(document).width(),
height: $(document).height(),
background: "white",
overflow: "auto"
});
});