织梦建站:视频弹出播放JS+CSS

需要 jquery.js 文件,JS代码一定要放在HTM下面,否则没效果罗!

CSS代码:

1.fdspbf{ width:650px; height:550px; position:fixed; left:50%; top:50%; margin:-265px 0 0 -315px; background:url(../images/ico_navbjh.png) repeat; padding:10px; z-index:99;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}
2.fdspbf .spclose{ position:absolute; right:5px; top:5px; width:15px; height:15px; background:url(../images/ico_close.png) no-repeat; cursor:pointer;}

 

HTM代码: 

<a href="javascript:void(0)" class="spbf" data-sp="http://cache.tv.qq.com/qqplayerout.swf?vid=z03002cxted">弹出播放</a>
http://static.video.qq.com/TPout.swf?vid=z03002cxted&auto=1

JS代码:

$('.spbf').each(function(index) {
$(this).click(function() {
$("body").append('<div class="fdspbf"><span class="spclose"></span><iframe height="100%" width="100%" src="'+$(this).attr("data-sp")+'" frameborder=0 allowfullscreen></iframe></div>');
$(".spclose").click(function() {
$(".fdspbf").remove();
});
});
});

  

上一篇:Ubuntu16.04安装TensorFlow及Mnist训练


下一篇:【Tools】ubuntu16.04安装搜狗输入法