Incrementing to next id in javascript
<p>I have an image I click which brings me to a page with some info and two buttons which are previous and next. </p>

<p>My code keeps going back to the same slide. How would I increment my "id" attribute to add +1 on my id attribute every time I click the next button or -1 for previous?</p>

<p>Here is my code</p>

<pre><code>    $(".portfolioLink").click(function(){

        // Hide slide and portfolio piece info
        $(".inner-content.portfolio").show();

        // Reset slides timer and pagination
        clearInterval($('#slides').data('interval'));
        $("ul.pagination li").removeClass("current");

        var slideID = $(this).parent().next().attr("id");

        $("#next").click(function() {
            slideswitch(slideID);
        });
    }
</code></pre>
