我想加載視頻onclick我的網頁中的圖像。爲此,我使用了下面的代碼。加載視頻時顯示加載圖標javascript
<script type="text/javascript">
(function($) {
$('a.newID').click(function(){
$('#newID').html('<iframe src="http://www.youtube.com/embed/TJ2X4dFhAC0?autoplay=1" frameborder="0" class="slide" allowtransparency="true" style="width:512px; height:288px;" id="ifm" title=""></iframe>');
});
}(jQuery));
</script>
的HTML代碼:
<a href="#" title="" id="newID"><span class="play_icon"><img src="img/play_overON.png" alt=""></span>
<img src="images/slider1.jpg" alt="" class="slide" />
</a>
如果我點擊圖像的圖像將由IFRAME視頻所取代。我需要的是display a loading icon
,直到video
是loading
。怎麼做?
http://stackoverflow.com/questions/6500515/how-can-i-have-a-loading-icon-appear-before-an-iframe-is-comepletely-loaded? –