<style>
#xfimg{
position: absolute;
right:-28px;
width:35px;
height:35px;
cursor: pointer;
}
#div1{
position: fixed;
z-index: 999999999;
float:left;
display: none;
}
</style>
<div id="div1"><img id="xfimg" src="__PUBLIC__/images/btn_start_help_press_close.png"/>{$cysj.content}</div>
<script>
function moveit(){
var left=parseInt($(window).width()*Math.random());
var top=parseInt($(window).height()*Math.random());
var leftw=parseInt($(window).width());
var divw=parseInt($("#div1").width());
var leftf=parseInt(left+divw);
var lefth=parseInt($(window).height());
var divh=parseInt($("#div1").height());
var leftfh=parseInt(top+divh);
if(leftf>leftw){
left=leftw-divw;
}
if(leftfh>lefth){
top=lefth-divh;
}
$("#div1").animate({"left":left,"top":top},15000);
setTimeout("moveit()",10500);
}
$(function(){
if({$cysj.status}==1){
$("#div1").show();
moveit();
}
$("#div1").mouseover(function(){
$(this).stop();
});
$("#div1").mouseout(function(){
moveit();
});
})
$("#xfimg").click(function(){
$("#div1").hide();
$("#div1").stop();
});
</script>
HTML 无规则浮动
最新推荐文章于 2022-10-05 21:45:45 发布