Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have a few things out of place but all in all, no biggie.</p> <p>First, </p> <pre><code>$('.next').click(function (event) { var cpage = $(this).find('a').attr('href'); </code></pre> <p>It can't call its self. <code>.next</code> is a class for the a tag, so how can a tag find inner elements with the a tag if it is the only a tag element? jQuery's <code>.find</code> works to find children and grandchildren and such of the element it's called upon. thus this line is just as easy written as:</p> <pre><code>var cpage = $(this).attr('href'); </code></pre> <p>Second,</p> <pre><code>cpage.removeClass('.cpage').addClass('fpage'); </code></pre> <p><code>cpage</code> is only a string variable, not a jQuery object, thus it needs a slight change. Try:</p> <pre><code>$(cPage).removeClass </code></pre> <p>I don't know what version of jQuery you are using, but I gave your code a complete scrub down and edit and posted a jsFiddle using the latest jQuery's. Important to note, if you're using an older version, some things might be different, such as <code>.on</code> being <code>.bind</code> or <code>.live</code> in older versions.</p> <p><a href="http://jsfiddle.net/SpYk3/SAm3r/" rel="nofollow"><h1>jsFiddle</h1></a></p> <pre><code>$(function() { $(".next").on("click", function(e) { e.preventDefault(); var cPage = $(this).attr("href"), fPage = $(this).closest("section"); fPage.addClass("anim").delay(500).queue(function(n) { $(this).removeClass().addClass('cpage'); n(); $(cPage).removeClass('.cpage').addClass('fpage'); }); }); }) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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