Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery interaction needs a Spring cleaning
    text
    copied!<p>I am using some jQuery interaction on a new site I'm building. The only problem is, I know only enough about it to be dangerous. Can someone help me clean this up? Works great, I just don't want to "splash" into the dom as much as I am. I'm sure there's a condensed way to accomplish this same thing. The ".rotate" function is actually calling a plugin that rotates images which I later manipulate in other ways. Thanks</p> <pre><code>(function($){})(window.jQuery); $(document).ready(function (){ $("#header").animate({ opacity: "1" }, 1000); $("#home_2").rotate(-10); $("#home_3").rotate(10); $("#home_4").rotate(20); $("#home_5").rotate(-20); var width = $(window).width(); $("#home_5").animate({ left: 44 + '%', opacity: "1" }, 1000); $("#home_4").delay(2000).animate({ right: 44 + '%', opacity: "1" }, 1000); $("#home_2").delay(6000).animate({ left: 48 + '%', opacity: "1" }, 1000); $("#home_3").delay(4000).animate({ right: 48 + '%', opacity: "1" }, 1000); $("#home_1").delay(8000).animate({ top: 200 + 'px', opacity: "1" }, 1000); var loc = window.location.href; $("nav ul li a").each(function() { if(this.href == loc) { $(this).addClass('current'); } }); $("#home_5").click(function(e) { $(this).toggleClass('stack_top'); $("#home_4,#home_3,#home_2,#home_1").removeClass('stack_top'); }); $("#home_4").click(function(e) { $(this).toggleClass('stack_top'); $("#home_5,#home_3,#home_2,#home_1").removeClass('stack_top'); }); $("#home_3").click(function(e) { $(this).toggleClass('stack_top'); $("#home_4,#home_5,#home_2,#home_1").removeClass('stack_top'); }); $("#home_2").click(function(e) { $(this).toggleClass('stack_top'); $("#home_4,#home_3,#home_5,#home_1").removeClass('stack_top'); }); $("#home_1").click(function(e) { $(this).toggleClass('stack_top'); $("#home_4,#home_3,#home_2,#home_5").removeClass('stack_top'); }); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload