代码拉取完成,页面将自动刷新
/**
* Created by Administrator on 2016/6/13.
*/
$(function (){
$(window).load(function (){
$('#zhuti').css({
margin: 0 +'px auto',
opacity: 1
});
});
$('#head ul li').eq(2).hover(function (){
$('#head ul li b').css({transform:"rotate(90deg)"});
$(this).css({height:'110px'});
},function (){
$('#head ul li b').css({transform:"rotate(0deg)"});
$(this).css({height: "20px"});
});
//登录框弹出事件
$('.goin').click(function (){
$('body').css('overflow', 'hidden');
$('.masking').css({
height: $(document).height() + 'px',
display:'block'});
$(' .ring').css({display:'block'});
});
//关注弹出事件
$('#head li div p').each(function (index){
$(this).click(function (){
$('body').css('overflow', 'hidden');
$(' .attention img').attr('src','../img/'+index+'.jpg');
$('.masking').css({
height: $(document).height() + 'px',
display:'block'});
$(' .attention').css({display:'block'});
return false;
})
});
//关闭弹出层
$('.close').each(function (){
$(this).click(function (){
$('body').css('overflow', 'auto');
$('.masking').css({display:'none'});
$(' .ring').css({display:'none'});
$(' .attention').css({display:'none'});
});
});
// 点击触发移动事件
$('.move').mousedown(function (e){
// console.log(e.clientX);//鼠标在视图中的位置
// console.log($('.goin').position().top);//元素的位置
var pointX = e.clientX + 175 - $('.ring').position().left;
// console.log(pointX);
var pointY = e.clientY + 200 - $('.ring').position().top;
// console.log(pointY);
// 移动事件
$('.move').mousemove(function (e){
var X = e.clientX - pointX + 175;
var Y = e.clientY - pointY + 200;
// 判断是否出了视图了
if (X<175){X=175}
if (X>$(window).width()-$(this).width() + 100){X=$(window).width()-$(this).width() +100}
if (Y<200){Y=200}
// console.log($(document).scrollTop());
// console.log($('.goin').position().top);
// console.log($('.goin').height());
// if (Y>$(window).height()-$('.ring').height() + 200){Y=$(window).height()-$('.goin').height() + 200}
$('.ring').css({
top: Y + 'px',
left: X + 'px'
});
});
// 移出和松开鼠标时清除移动事件
}).mouseup(function (){
$(this).unbind('mousemove');
}).mouseout(function (){
$(this).unbind('mousemove');
});
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。