0
<iframe src="#" scrolling="no" id="gallery-frame">
<div class="gv_filmstrip">
<div class="gv_frame">
<div class="gv_thumbnail current">
<img src="images/grandstand-padang-right/1.jpg">
</div></div>
<div class="gv_frame">
<div class="gv_thumbnail">
<img src="images/grandstand-padang-right/2.jpg">
</div></div>
<div class="gv_frame">
<div class="gv_thumbnail">
<img src="images/grandstand-padang-right/3.jpg">
</div></div>
</div>
<div class="gv_panel"><img src="images/grandstand-padang-right/1.jpg"></div>
<div class="gv_panel"><img src="images/grandstand-padang-right/2.jpg"></div>
<div class="gv_panel"><img src="images/grandstand-padang-right/3.jpg"></div>
</iframe>
我想要的是什麼? 我想訪問類gv_frame
,把一個onclick事件就可以了。在onclick事件我需要找到的img
的寬度和高度gv_panel
腳本我試過..
$("#gallery-frame").contents().find("gv_frame").click(function(){
alert("aaa"); // I am not getting the alert
});
第二次嘗試
var width = $(".gv_panel img").width();
var height = $(".gv_panel img").height();
alert("width:"+width+" and height :"+height); // alert is null here
我已嘗試。作爲gv_frame和所有在iframe中..its不是不知爲什麼... –
工作..sumhow療法shud是方式來獲得的元素iframe中訪問.. –