Difference between revisions of "Template:SJTU-Software/requirementJs"
Ricky chen (Talk | contribs) |
Ricky chen (Talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
+ | $("html").niceScroll(); | ||
$('area').click(open); | $('area').click(open); | ||
$('.am-close').click(close) | $('.am-close').click(close) | ||
Line 15: | Line 16: | ||
var id = $(this).attr("href"); | var id = $(this).attr("href"); | ||
$(id).css("display","block"); | $(id).css("display","block"); | ||
+ | var bro = $(this).siblings(); | ||
+ | bro.each(function(){ | ||
+ | id = $(this).attr("href"); | ||
+ | $(id).css("display","none") | ||
+ | }) | ||
+ | |||
} | } | ||
var close = function(){ | var close = function(){ | ||
$(this).parent().css("display","none"); | $(this).parent().css("display","none"); | ||
} | } |
Latest revision as of 23:55, 18 September 2015
$(document).ready(function(){
$("html").niceScroll();
$('area').click(open); $('.am-close').click(close) $('#bronze1').click(function(){ $('#bronze1-4').css("display","block"); }); $('#bronze1-4').click(function(){ $(this).css("display","none") }); });
var open = function(){ var id = $(this).attr("href"); $(id).css("display","block"); var bro = $(this).siblings(); bro.each(function(){ id = $(this).attr("href"); $(id).css("display","none") })
} var close = function(){ $(this).parent().css("display","none"); }