您的位置:首页 > Web前端 > JavaScript

js 滚动加载iframe框中内容

2015-12-12 22:50 726 查看
var isIE6 = !!window.ActiveXObject&&!window.XMLHttpRequest;

//滚动加载
var scrollLoad =function(){
$("#content iframe[_src]").each(function(){
var t = $(this);
if( t.offset().top<= $(document).scrollTop() + $(window).height()  )
{
t.attr( "src",t.attr("_src") ).removeAttr("_src");
}
});//each E
}

scrollLoad();
$(window).scroll(function(){
if(isIE6){ btb.css("top", $(document).scrollTop()+30) }
//scrollLoad();
});


<iframe allowTransparency="true" scrolling="no" _src="demo/iframe/2.0-focus-iframe.html?&fade&true" frameborder="0"></iframe>


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: