Team:ATOMS-Turkiye/Templates/AutohideContent
From 2013.igem.org
(Difference between revisions)
(5 intermediate revisions not shown) | |||
Line 10: | Line 10: | ||
function toggleContent(){ | function toggleContent(){ | ||
next = $(this).parent().next(); | next = $(this).parent().next(); | ||
- | |||
if(next.is(':animated')) | if(next.is(':animated')) | ||
- | + | return; | |
if(next.hasClass("contentVisible")) | if(next.hasClass("contentVisible")) | ||
{ | { | ||
next.removeClass("contentVisible") | next.removeClass("contentVisible") | ||
- | next.show(); | + | next.show(300); |
} | } | ||
else | else | ||
{ | { | ||
next.addClass("contentVisible"); | next.addClass("contentVisible"); | ||
- | next.hide(); | + | next.hide(300); |
} | } | ||
} | } | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
- | $(".article .mw-headline").click(toggleContent); | + | $(".article h2 .mw-headline").click(toggleContent); |
- | $(".article .mw-headline").addClass("contentVisible"); | + | a = $(".article h2 .mw-headline").parent().next(); |
- | + | a.addClass("contentVisible"); | |
- | + | a.hide(); | |
- | + | a = a.eq(0); | |
+ | a.removeClass("contentVisible"); | ||
+ | a.show(); | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 00:51, 5 October 2013