导航菜单
< language="java" type="text/java">/** jQuery Plugins imgFloat v1011* 使用说明:* speed //元素移动速度* xPos //元素一开始左距离* yPos //元素一开始上距离* $('#div1').imgFloat({speed:30,xPos:10,yPos:10});* $('#div2').imgFloat(); //不给参数默认(speed:15,xPos:0,yPos:0) */ (function($) { jQuery.fn.imgFloat = function(options) { var own = this; var xD = 0; var yD = 0; var i = 1; var settings = { speed : 15, xPos : 0, yPos : 0 }; jQuery.extend(settings, options); var ownTop = settings.xPos; var ownLeft = settings.yPos; own.css({ position : "absolute", cursor : "pointer" }); function imgPosition() { var winWidth = $(window).width() - own.width(); var winHeight = $(window).height() - own.height(); if (xD == 0) { ownLeft += i; own.css({ left : ownLeft }); if (ownLeft >= winWidth) { ownLeft = winWidth; xD = 1; } } if (xD == 1) { ownLeft -= i; own.css({ left : ownLeft }); if (ownLeft <= 0) xD = 0; } if (yD == 0) { ownTop += i; own.css({ top : ownTop }); if (ownTop >= winHeight) { ownTop = winHeight; yD = 1; } } if (yD == 1) { ownTop -= i; own.css({ top : ownTop }); if (ownTop <= 0) yD = 0; } } var imgHover = setInterval(imgPosition, settings.speed); own.hover(function() { clearInterval(imgHover); }, function() { imgHover = setInterval(imgPosition, settings.speed); }); } })(jQuery); < language="java" type="text/java"> //$("#img").imgFloat(); //不给参数默认(speed:10,xPos:0,yPos:0) $("#img").imgFloat({ speed : 15, xPos : 10, yPos : 10 }); $(".reset").click(function() { $("#img").css("display", "none"); });
关闭×
图标素材
 
会员登录
登录账号
密码
验证码
您好,您已登录!  您有条新到站内短信  进入会员中心  退出登录
 
当前位置
图片分类
图片详情
圣诞狂欢(7.10杜宇鑫)
 

   
赤峰市红山中学版权所有    技术支持:启天网络

    地址:赤峰市红山区桥北新区龙头山路  公交路线:2路、201路  蒙公网安备 15040202150482号