/* spig.js */
//右鍵菜單
jQuery(document).ready(function ($) {
$jq("#spig").mousedown(function (e) {
if(e.which==3){
showMessage("秘密通道:
訂閱 首頁 關閉",10000);
}
});
$jq("#spig").bind("contextmenu", function(e) {
return false;
});
});
//鼠標在消息上時
jQuery(document).ready(function ($) {
$jq("#message").hover(function () {
$jq("#message").fadeTo("100", 1);
});
});
//鼠標在上方時
jQuery(document).ready(function ($) {
//$jq(".mumu").jrumble({rangeX: 2,rangeY: 2,rangeRot: 1});
$jq(".mumu").mouseover(function () {
$jq(".mumu").fadeTo("300", 0.3);
msgs = ["我隱身了,你看不到我", "我會隱身哦!嘿嘿!", "別動手動腳的,把手拿開!", "把手拿開我才出來!"];
var i = Math.floor(Math.random() * msgs.length);
showMessage(msgs[i]);
});
$jq(".mumu").mouseout(function () {
$jq(".mumu").fadeTo("300", 1)
});
});
//開始
jQuery(document).ready(function ($) {
if (isindex) { //如果是主頁
var now = (new Date()).getHours();
if (now > 0 && now <= 6) {
showMessage(' 你是夜貓子呀?還不睡覺,明天起的來麼你?', 6000);
} else if (now > 6 && now <= 11) {
showMessage(' 早上好,早起的鳥兒有蟲吃噢!早起的蟲兒被鳥吃,你是鳥兒還是蟲兒?嘻嘻!', 6000);
} else if (now > 11 && now <= 14) {
showMessage(' 中午了,吃飯了麼?不要餓著了,餓死了誰來挺我呀!', 6000);
} else if (now > 14 && now <= 18) {
showMessage(' 中午的時光真難熬!還好有你在!', 6000);
} else {
showMessage(' 快來逗我玩吧!', 6000);
}
}
else {
showMessage('歡迎來到吹水冰室動漫資訊論壇《' + title + '》', 6000);
}
$jq(".spig").animate({
top: $jq(".spig").offset().top + 300,
left: document.body.offsetWidth - 160
},
{
queue: false,
duration: 1000
});
});
//鼠標在某些元素上方時
jQuery(document).ready(function ($) {
$jq('.icont a').click(function () {//標題被點擊時
showMessage('正在用吃奶的勁加載《' + $jq(this).text() + '》請稍候');
});
$jq('.hlnew,#forum1 p a,#forum2 p a,#forum3 p a,#forum4 p a,#forum5 p a,#forum6 p a,#forum7 p a,#forum8 p a,#forum9 p a,#forum10 p a,#forum11 p a,#forum12 p a,#forum3 p a,#forum14 p a,#forum15 p a,#forum16 p a,#forum17 p a,#forum18 p a,#forum19 p a,#forum20 p a,#forum21 p a,#forum22 p a,#forum23 p a,#forum24 p a').mouseover(function () {
showMessage('要看看《' + $jq(this).text() + '》這篇文章麼?');
});
$jq('.prev').mouseover(function(){
showMessage('要翻到上一頁嗎?');
});
$jq('.next').mouseover(function(){
showMessage('要翻到下一頁嗎?');
});
$jq('.subject.new a,.subject.common a').mouseover(function () {
showMessage('去 ' + $jq(this).text() + ' 逛逛');
});
$jq('.fastreply').mouseover(function () {
showMessage('向評論欄出發吧! ');
});
$jq('#fastpostmessage').mouseover(function () {
showMessage('認真填寫哦!不然會被認作垃圾評論的!我的乖乖~! ');
});
$jq('.postbtn a').mouseover(function () {
showMessage('最愛的就是這個按鈕了,快發帖和大家一起分享吧! ');
});
$jq('#fastpostsubmit').mouseover(function () {
showMessage('確認提交了麼?');
});
$jq('#scbar_txt').mouseover(function () {
showMessage('輸入你想搜索的關鍵詞再按Enter(回車)鍵就可以搜索啦!');
});
$jq('.pageback').mouseover(function () {
showMessage('點它可以後退哦!');
});
$jq('#go-next').mouseover(function () {
showMessage('點它可以前進哦!');
});
$jq('.replybtn a').mouseover(function () {
showMessage('點它可以回覆該帖哦!');
});
$jq('#scrolltop a').mouseover(function () {
showMessage('快速返回頂部!');
});
$jq('#refresh').mouseover(function () {
showMessage('點它可以重新載入此頁哦!');
});
$jq('#nav a').mouseover(function () {
showMessage('點它就可以回到首頁啦!');
});
$jq('#ajax_favorite').mouseover(function () {
showMessage('點它可以把此頁加入收藏哦!');
});
$jq('.menu_45 a').mouseover(function () {
showMessage('噓,從這裡可以進入裝扮商城的哦!');
});
$jq('.menu_9 a').mouseover(function () {
showMessage('這里可以查看小工具!');
});
$jq('.menu_24 a').mouseover(function () {
showMessage('這里可以調用音樂盒!');
});
$jq('.menu_63 a').mouseover(function () {
showMessage('親,我不在時就給我留言吧!');
});
$jq('.tf_w a').mouseover(function () {
showMessage('點擊查看此分類下得所有文章');
});
$jq('.zypi_postbox_btn.cmmnt').mouseover(function () {
showMessage('點它可以直接點評此樓觀點哦.');
});
$jq('.sharep i').mouseover(function () {
showMessage('你知道嗎?點它可以分享本文到'+$jq(this).attr('title'));
});
$jq('#switch-to-wap').mouseover(function(){
showMessage('點擊可以切換到手機版博客版面');
});
});
//無聊講點什麼
jQuery(document).ready(function ($) {
window.setInterval(function () {
msgs = ["播報今日天氣", "陪我聊天吧!", "
", "好無聊哦,你都不陪我玩!", "…@……!………", "^%#&*!@*(&#)(!)(", "我可愛吧!嘻嘻!~^_^!~~","誰淫蕩呀?~誰淫蕩?,你淫蕩呀!~~你淫蕩!~~","從前有座山,山上有座廟,廟里有個老和尚給小和尚講故事,講:“從前有座……”"];
var i = Math.floor(Math.random() * msgs.length);
showMessage(msgs[i], 10000);
}, 35000);
});
//無聊動動
jQuery(document).ready(function ($) {
window.setInterval(function () {
msgs = ["播報今日天氣", "快快訂閱我的博客吧!
", "乾坤大挪移!", "我飄過來了!~", "我飄過去了", "我得意地飄!~飄!~"];
var i = Math.floor(Math.random() * msgs.length);
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);
$jq(".spig").animate({
left: document.body.offsetWidth/2*(1+s[i1]),
top: document.body.offsetHeight/2*(1+s[i1])
},
{
duration: 2000,
complete: showMessage(msgs[i])
});
}, 45000);
});
//評論資料
jQuery(document).ready(function ($) {
$jq("#username").click(function () {
showMessage("留下你的尊姓大名!");
$jq(".spig").animate({
top: $jq("#ls_username").offset().top - 70,
left: $jq("#ls_username").offset().left - 170
},
{
queue: false,
duration: 1000
});
});
$jq("#email").click(function () {
showMessage("留下你的郵箱,不然就是無頭像人士了!");
$jq(".spig").animate({
top: $jq("#email").offset().top - 70,
left: $jq("#email").offset().left - 170
},
{
queue: false,
duration: 1000
});
});
$jq("#url").click(function () {
showMessage("快快告訴我你的家在哪裡,好讓我去參觀參觀!");
$jq(".spig").animate({
top: $jq("#url").offset().top - 70,
left: $jq("#url").offset().left - 170
},
{
queue: false,
duration: 1000
});
});
$jq("#comment").click(function () {
showMessage("認真填寫哦!不然會被認作垃圾評論的!我的乖乖~");
$jq(".spig").animate({
top: $jq("#comment").offset().top - 70,
left: $jq("#comment").offset().left - 170
},
{
queue: false,
duration: 1000
});
});
});
var spig_top = 50;
//滾動條移動
jQuery(document).ready(function ($) {
var f = $jq(".spig").offset().top;
$jq(window).scroll(function () {
$jq(".spig").animate({
top: $jq(window).scrollTop() + f +300
},
{
queue: false,
duration: 1000
});
});
});
//鼠標點擊時
jQuery(document).ready(function ($) {
var stat_click = 0;
$jq(".mumu").click(function () {
if (!ismove) {
stat_click++;
if (stat_click > 4) {
msgs = ["你有完沒完呀?", "你已經摸我" + stat_click + "次了", "非禮呀!救命!OH,My ladygaga"];
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);
$jq(".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 ($) {
$jq("#spig").mousedown(function (e) {
_move = true;
_x = e.pageX - parseInt($jq("#spig").css("left"));
_y = e.pageY - parseInt($jq("#spig").css("top"));
});
$jq(document).mousemove(function (e) {
if (_move) {
var x = e.pageX - _x;
var y = e.pageY - _y;
var wx = $jq(window).width() - $jq('#spig').width();
var dy = $jq(document).height() - $jq('#spig').height();
if(x >= 0 && x <= wx && y > 0 && y <= dy) {
$jq("#spig").css({
top: y,
left: x
}); //控件新位置
ismove = true;
}
}
}).mouseup(function () {
_move = false;
});
});
var isindex = true;
var visitor = true;