Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
||
第7行: | 第7行: | ||
var questions = $('.question'); |
var questions = $('.question'); |
||
⚫ | |||
var temp = questions.children("center").not(':eq(-1)'); |
var temp = questions.children("center").not(':eq(-1)'); |
||
+ | |||
⚫ | |||
+ | function bind($this, next) { |
||
⚫ | |||
− | var current = $(this).parents('.question:eq(0)'); |
+ | var current = $($this).parents('.question:eq(0)'); |
if(current.data('delay')) { |
if(current.data('delay')) { |
||
setTimeout(function() { |
setTimeout(function() { |
||
current.hide(); |
current.hide(); |
||
− | + | next.show(); |
|
}, parseInt(current.data('delay'))); |
}, parseInt(current.data('delay'))); |
||
− | $(this).off('click'); |
+ | $($this).off('click'); |
return; |
return; |
||
} |
} |
||
current.hide(); |
current.hide(); |
||
+ | next.show(); |
||
⚫ | |||
⚫ | |||
+ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}); |
}); |
||
temp.find(':nth-child(2)').children().click(function() { |
temp.find(':nth-child(2)').children().click(function() { |
||
⚫ | |||
− | var current = $(this).parents('.question:eq(0)'); |
||
− | current.hide(); |
||
⚫ | |||
}); |
}); |
||
2015年3月29日 (日) 12:07的版本
<script> (function Terry2(){ if(typeof jQuery == "undefined") { setTimeout(Terry2, 100); return; }
var questions = $('.question'); var temp = questions.children("center").not(':eq(-1)');
function bind($this, next) { var current = $($this).parents('.question:eq(0)'); if(current.data('delay')) { setTimeout(function() { current.hide(); next.show(); }, parseInt(current.data('delay'))); $($this).off('click'); return; } current.hide(); next.show(); }
temp.children().css('cursor', 'pointer'); temp.find(':first-child').children().click(function() { bind(this, questions.eq(parseInt(current.data('yes')) - 1)); }); temp.find(':nth-child(2)').children().click(function() { bind(this, questions.eq(parseInt(current.data('no')) - 1)); });
questions.eq(0).show();
$('.wikia-logo').attr('href', 'http://zh.tos.wikia.com/wiki/臨時主頁');
$('a[href="https:\/\/www.facebook.com/zhtoswikia"]').attr('target', '_blank');
})(); </script>