Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:25:12+00:00 2026-06-17T09:25:12+00:00

Trying to create some next and previous functionality here. Navigating through different HTML5 sections

  • 0

Trying to create some next and previous functionality here. Navigating through different HTML5 sections using hide and show, is it possible, for my back button, to find whichever div was last visible and show it?

This is my relevant html

    <div id="next"><img src="img/next.png" alt="" onclick="nextPage()"></div>

    <section id="splash">
        <br><br><br>
        <center>
        <img src="img/home.jpg" alt="">
        </center>
    </section>

    <section id="home">
        <br><br><br><br><br>
        <center>
        <ul id="nav">
            <li><img src="img/feat_btn.png" alt="" onclick="nextPage('feat-home')"></li>
            <li><img src="img/models_btn.png" alt="" onclick="nextPage('model-lineup')"></li>
            <li><img src="img/quiz_btn.png" alt="" onclick="nextPage('quiz')"></li>
        </ul>
        </center>
    </section>

    <section id="feat-home">feat home</section>
    <section id="feat-e-menu">e menu</section>
    <section id="feat-g-menu">g menu</section>
    <section id="feat-i-menu">i menu</section>
    <section id="model-lineup">lineup</section>
    <section id="model-YWFE540H0A">model</section>
    <section id="quiz">quiz</section>

relevant js

function nextPage(link) {
    var vis = $("section:visible");
    var next = vis.next();

    if (link) {
        var link = "#" + link;
        vis.hide();
        $(link).show();
    } else {
        vis.hide();
        next.show();
    }
  }

So, the next button will take you through the flow off the app, but you are also able to press buttons to get to where you want to go, which is why I cant just have the back button show the prev section and hide the current one.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:25:13+00:00Added an answer on June 17, 2026 at 9:25 am

    On click, you will need to store what is currently being shown in a separate variable and use that for your previous button clicks.

    When previous button is clicked show what is in the “previously shown” variable.

    You will need to disable the previous button when it’s a fresh page load.

    This really does look a lot like some of the content slider plugins that are out there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying to create some graphs using Core Plot, but for the following
I am trying to create previous/next node navigation on my nodes in order to
I am trying to create dynamic next and previous buttons with javascript. I am
I am trying to create some capacity planning reports and one of the requrements
I am trying to create some reusable components in Silverlight2 . The difficulty comes
I am trying to create some charts of data (eg http://www.amibroker.com/ ). Is there
I am trying to create some rules and facts on a certain situation. The
I am trying to create some global variables in a firefox extension. In my
I am trying to create some script variables in T-SQL as follows: /* Deployment
I am trying to create some dynamic html out of some data from db.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.