不然会被认作垃圾评论的!我的乖乖~");
$(".spig").animate({
top: $("#comment").offset().top - 70,
left: $("#comment").offset().left - 170
},
{
queue: false,
duration: 1000
});
});*/
$("input[name='content']").click(function () {
showMessage("我会在看着的,认真填写哦!");
$(".spig").animate({
top: $("#comment").offset().top - 70,
left: $("#comment").offset().left - 170
},
{
queue: false,
duration: 1000
});
});
});
var spig_top = 50;
//滚动条移动
jQuery(document).ready(function ($) {
var f = $(".spig").offset().top;
$(window).scroll(function () {
$(".spig").animate({
top: $(window).scrollTop() + f +360
},
{
queue: false,
duration: 1000
});
});
});
//鼠标点击时
jQuery(document).ready(function ($) {
var stat_click = 0;
$(".mumu").click(function () {
if (!ismove) {
stat_click++;
if (stat_click > 4) {
msgs = ["你有完没完呀?", "你已经摸我" + stat_click + "次了", "四之弹(时间倒流)~ 你摸不到我的"];
var i = Math.floor(Math.random() * msgs.length);
//showMessage(msgs[i]);
} else {
msgs = ["我飞~我飞~我飞呀飞呀飞呀飞!", "一之弹(时间加速)~~", "别摸我,再摸我就要告诉梦缘溪行哟!", "再这样我真的告诉梦缘溪行了!", "不要摸我了,我会告诉梦缘溪行的!", "小心我吞噬了你"];
var i = Math.floor(Math.random() * msgs.length);
//showMessage(msgs[i]);
}
s = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6,0.7,0.75,-0.1, -0.2, -0.3, -0.4, -0.5, -0.6,-0.7,-0.75];
var i1 = Math.floor(Math.random() * s.length);
var i2 = Math.floor(Math.random() * s.length);
$(".spig").animate({
left: document.body.offsetWidth/2*(1+s[i1]),
top: document.body.offsetHeight/2*(1+s[i1])
},
{
duration: 500,
complete: showMessage(msgs[i])
});
} else {
ismove = false;
}
});
});
//显示消息函数
function showMessage(a, b) {
if (b == null) b = 10000;
jQuery("#message").hide().stop();
jQuery("#message").html(a);
jQuery("#message").fadeIn();
jQuery("#message").fadeTo("1", 1);
jQuery("#message").fadeOut(b);
};
//拖动
var _move = false;
var ismove = false; //移动标记
var _x, _y; //鼠标离控件左上角的相对位置
jQuery(document).ready(function ($) {
$("#spig").mousedown(function (e) {
_move = true;
_x = e.pageX - parseInt($("#spig").css("left"));
_y = e.pageY - parseInt($("#spig").css("top"));
});
$(document).mousemove(function (e) {
if (_move) {
var x = e.pageX - _x;
var y = e.pageY - _y;
var wx = $(window).width() - $('#spig').width();
var dy = $(document).height() - $('#spig').height();
if(x >= 0 && x <= wx && y > 0 && y <= dy) {
$("#spig").css({
top: y,
left: x
}); //控件位置
ismove = true;
}
}
}).mouseup(function () {
_move = false;
});
});
Back to home |
File page
Subscribe |
Register |
Login
| N