Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var animatieView = {
  2.     bouncetime: 2000,
  3.     maxWidth: 275,
  4.     maxPadding: 20,
  5.     init: function () {
  6.         $("figure").click(function () {
  7.             if ($(".descr:visible").length === 0) {
  8.                 $(this).next().animate({width: animatieView.maxWidth, padding: animatieView.maxPadding},                    animatieView.bouncetime).css({display: "inline-block"});
  9.             }
  10.             else {
  11.                 if ($(this).next().css("display") === "none") {
  12.                     $(".descr:visible").animate({width: "0px", padding: "0px"}, animatieView.bouncetime, function () {
  13.                         $(".descr:visible").css({display: "none"});
  14.                         $(this).next().animate({width: animatieView.maxWidth, padding: animatieView.maxPadding}, animatieView.bouncetime).css({display: "inline-block"});
  15.                     });
  16.                 }
  17.             }
  18.         });
  19.     }
  20. };
  21.  
  22. $(document).ready(function () {
  23.     animatieView.init();
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement