Team:ATOMS-Turkiye/Templates/AutohideContent

From 2013.igem.org

(Difference between revisions)
 
(8 intermediate revisions not shown)
Line 9: Line 9:
function toggleContent(){
function toggleContent(){
-
   next = $(this).next();
+
   next = $(this).parent().next();
-
  console.log("asdasd "+next);
+
   if(next.is(':animated'))
   if(next.is(':animated'))
-
   next.stop();
+
   return;
   if(next.hasClass("contentVisible"))
   if(next.hasClass("contentVisible"))
   {
   {
     next.removeClass("contentVisible")
     next.removeClass("contentVisible")
-
     next.show();
+
     next.show(300);
   }
   }
   else
   else
   {
   {
-
     next.add("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);
 +
  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