Difference between revisions of "Template:SJTU-Software/teamJs"
Ricky chen (Talk | contribs) |
Ricky chen (Talk | contribs) |
||
Line 3: | Line 3: | ||
$("html").niceScroll(); | $("html").niceScroll(); | ||
$('.membersNav').click(changePage); | $('.membersNav').click(changePage); | ||
− | + | $('img').click(show); | |
+ | $('.colorful').click(hide) | ||
}); | }); | ||
var changePage = function(){ | var changePage = function(){ | ||
Line 15: | Line 16: | ||
} | } | ||
− | var | + | var show = function(){ |
− | var target = $(this).attr(" | + | var target = $(this).attr("id"); |
− | target = $(target); | + | target = "#"+target+"2"; |
− | + | $(target).css("width","100%"); | |
− | + | $(target).css("-webkit-transform","rotate(360deg)"); | |
− | + | $(target).css("display","block") | |
− | + | } | |
− | + | ||
+ | var hide = function(){ | ||
+ | $(this).css("width","0"); | ||
+ | |||
} | } |
Latest revision as of 11:03, 18 September 2015
$(document).ready(function(){ $(".fixed-nav").css("top",$(window).height()*0.3); $("html").niceScroll(); $('.membersNav').click(changePage); $('img').click(show); $('.colorful').click(hide) }); var changePage = function(){ var active = $(this).attr("id"); var bros = $(this).siblings(); $("."+active).css("display","inline"); bros.each(function(){ active = $(this).attr("id"); $("."+active).css("display","none"); }) }
var show = function(){ var target = $(this).attr("id"); target = "#"+target+"2"; $(target).css("width","100%"); $(target).css("-webkit-transform","rotate(360deg)"); $(target).css("display","block") }
var hide = function(){ $(this).css("width","0");
}