Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
||
第9行: | 第9行: | ||
var temp = questions.children("center").children().css('cursor', 'pointer'); |
var temp = questions.children("center").children().css('cursor', 'pointer'); |
||
− | temp.eq( |
+ | temp.eq(0).children().click(function() { |
var current = $(this).parents('.question:eq(0)'); |
var current = $(this).parents('.question:eq(0)'); |
||
current.hide(); |
current.hide(); |
||
questions.eq(current.data('yes')).show(); |
questions.eq(current.data('yes')).show(); |
||
+ | }); |
||
+ | temp.eq(1).children().click(function() { |
||
+ | var current = $(this).parents('.question:eq(0)'); |
||
+ | current.hide(); |
||
+ | questions.eq(current.data('no')).show(); |
||
}); |
}); |
||
2015年3月28日 (六) 12:31的版本
<script> (function Terry2(){ if(typeof jQuery == "undefined") { setTimeout(Terry2, 100); return; }
var questions = $('.question');
var temp = questions.children("center").children().css('cursor', 'pointer'); temp.eq(0).children().click(function() { var current = $(this).parents('.question:eq(0)'); current.hide(); questions.eq(current.data('yes')).show(); }); temp.eq(1).children().click(function() { var current = $(this).parents('.question:eq(0)'); current.hide(); questions.eq(current.data('no')).show(); });
questions.eq(0).show();
})(); </script>