FANDOM


(撤销由Ken2812221讨论)所作出的修订289787)
第1行: 第1行:
 
<script>
 
<script>
 
(function Terry2(){
 
(function Terry2(){
if(typeof jQuery == "undefined") {
+
if(typeof jQuery == 'undefined') {
 
setTimeout(Terry2, 100);
 
setTimeout(Terry2, 100);
 
return;
 
return;
第8行: 第8行:
 
var questions = $('.question');
 
var questions = $('.question');
 
var temp = questions.children("center").not(':eq(-1)');
 
var temp = questions.children("center").not(':eq(-1)');
  +
var picsp = $('.fool_story_progress');
  +
var pics = picsp.children();
 
 
 
function show(div) {
 
function show(div) {
 
div.show();
 
div.show();
  +
if(div.data('storyInterval')) {
  +
var imgages = div.children('img');
  +
var picNum = images.length;
  +
var currentIndex = 0;
  +
  +
function moveNext() {
  +
if(currentIndex >= picNum) {
  +
div.hide();
  +
show(questions.eq(parseInt(div.data('yes'))));
  +
return;
  +
}
  +
images.eq(currentIndex).hide();
  +
  +
currentIndex++;
  +
  +
images.eq(currentIndex).show();
  +
  +
setTimeout(moveNext, div.data('sotryInterval'));
  +
}
  +
  +
setTimeout(moveNext, div.data('storyInterval'));
  +
}
  +
 
if(div.data('autoSkip')) {
 
if(div.data('autoSkip')) {
 
setTimeout(function() {
 
setTimeout(function() {
 
div.hide();
 
div.hide();
show(questions.eq(parseInt(div.data('yes')) - 1));
+
show(questions.eq(parseInt(div.data('yes')) + 1));
 
}, parseInt(div.data('autoSkip')));
 
}, parseInt(div.data('autoSkip')));
 
}
 
}
第44行: 第69行:
 
}
 
}
   
  +
  +
 
temp.children().css('cursor', 'pointer');
 
temp.children().css('cursor', 'pointer');
temp.find(':first-child').children().click(function() {
+
questions.onload = function() {
var current = $(this).parents('.question:eq(0)');
+
temp.find(':first-child').children().click(function() {
bind(this, current, questions.eq(parseInt(current.data('yes')) - 1));
+
var current = $(this).parents('.question:eq(0)');
});
+
bind(this, current, questions.eq(parseInt(current.data('yes')) - 1));
temp.children().not(temp.find(':first-child')).children().click(function() {
+
});
var current = $(this).parents('.question:eq(0)');
+
temp.children().not(temp.find(':first-child')).children().click(function() {
bind(this, current, questions.eq(parseInt(current.data('no')) - 1));
+
var current = $(this).parents('.question:eq(0)');
});
+
bind(this, current, questions.eq(parseInt(current.data('no')) - 1));
  +
});
  +
};
 
 
 
 
第62行: 第89行:
   
 
$('a[href="https:\/\/www.facebook.com/zhtoswikia"]').attr('target', '_blank');
 
$('a[href="https:\/\/www.facebook.com/zhtoswikia"]').attr('target', '_blank');
  +
  +
  +
pics.hide();
  +
pics.eq(0).show();
  +
 
 
 
})();
 
})();

2015年3月31日 (二) 13:34的版本

<script> (function Terry2(){ if(typeof jQuery == 'undefined') { setTimeout(Terry2, 100); return; }

var questions = $('.question'); var temp = questions.children("center").not(':eq(-1)'); var picsp = $('.fool_story_progress'); var pics = picsp.children();

function show(div) { div.show(); if(div.data('storyInterval')) { var imgages = div.children('img'); var picNum = images.length; var currentIndex = 0;

function moveNext() { if(currentIndex >= picNum) { div.hide(); show(questions.eq(parseInt(div.data('yes')))); return; } images.eq(currentIndex).hide();

currentIndex++;

images.eq(currentIndex).show();

setTimeout(moveNext, div.data('sotryInterval')); }

setTimeout(moveNext, div.data('storyInterval')); }

if(div.data('autoSkip')) { setTimeout(function() { div.hide(); show(questions.eq(parseInt(div.data('yes')) + 1)); }, parseInt(div.data('autoSkip'))); } }

function bind($this, current, next) { if(current.data('delay')) { setTimeout(function() { current.hide(); show(next); }, parseInt(current.data('delay'))); $($this).off('click'); return; } if(current.data('exit')) { current.find('a:eq(0)').click(function() { setCookie('fools_played', '1', 1); }); } current.hide(); show(next); }

function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/"; }


temp.children().css('cursor', 'pointer'); questions.onload = function() { temp.find(':first-child').children().click(function() { var current = $(this).parents('.question:eq(0)'); bind(this, current, questions.eq(parseInt(current.data('yes')) - 1)); }); temp.children().not(temp.find(':first-child')).children().click(function() { var current = $(this).parents('.question:eq(0)'); bind(this, current, questions.eq(parseInt(current.data('no')) - 1)); }); };


show(questions.eq(0));

$('.wikia-logo').attr('href', 'http://zh.tos.wikia.com/wiki/臨時主頁').click(function() { setCookie('fools_played', '1', 1); });

$('a[href="https:\/\/www.facebook.com/zhtoswikia"]').attr('target', '_blank');


pics.hide(); pics.eq(0).show();


})(); </script>

除了特别提示,社区内容遵循CC-BY-SA 授权许可。