Sliding through a webpage effortlessly with jQuery slider equipped with main navigation and sub

Currently, my slider utilizes arrows and dots for navigation. I am looking to enhance it by adding a multi-page directory on the right side of the slider. This directory will have numbered pages, each containing a different set of images in arrays corresponding to the page number.

I'm facing difficulties linking each "01", "02", "03" page to their respective arrays of images. Instead of cycling through sample images as it does now, clicking on each number should bring up a different collection of images into the slider.

I have included a demo here to provide clarity. However, please note that the dot navigation is not operational on the provided link due to technical issues with jsfiddle. Nevertheless, it works fine separately in my text editing software.

What would be the most effective method to achieve this desired effect?

Thank you. https://i.sstatic.net/LNyYX.png

HTML

<div id="rectangle">
  <div class="nav">
    <ul>
       <li class="first"><a href="#">01</a></li>
       <li class="second"><a href="#">02</a></li>
       <li class="third"><a href="#">03</a></li>
    </ul>
 </div>
</div>
<div class="image-box">
  <img class="p-first" src="img/SampleImage.png" width="300" height="200">
  <img class="p-first" src="img/SampleImage.png" width="300" height="200">
  <img class="p-first" src="img/SampleImage.png" width="300" height="200">
</div>

<div class="image-box">
  <img class="p-second" src="img/SampleImage.png" width="300" height="200">
  <img class="p-second" src="img/SampleImage.png" width="300" height="200">
  <img class="p-second" src="img/SampleImage.png" width="300" height="200">
</div>

<div class="image-box">
  <img class="p-third" src="img/SampleImage.png" width="300" height="200">
  <img class="p-third" src="img/SampleImage.png" width="300" height="200">
  <img class="p-third" src="img/SampleImage.png" width="300" height="200">
</div>


<nav class="slider-nav">
  <div class="nav-list">
    <div class="nav-label">Digital</div>
      <div class="nav-dot select"></div>
         <div class="nav-dot"></div>
         <div class="nav-dot"></div>
         <div class="nav-dot"></div>
</div>
<div class="nav-spacing"></div>
   <div class="nav-list">
      div class="nav-label">Physical</div>
        <div class="nav-dot select"></div>
        <div class="nav-dot"></div>
        <div class="nav-dot"></div>
        <div class="nav-dot"></div>
  </div>
</nav>

jQuery

      $(document).ready(function () {
        $(".p-first, .p-second, .p-third").hide();
    });


    $(document).ready(function () {
        $(".first").click(function () {
            $(".p-first").toggle();
        });
    });

    $(document).ready(function () {
        $(".second").click(function () {
            $(".p-second").toggle();
        });
    });

    $(document).ready(function () {
        $(".third").click(function () {
            $(".p-third").toggle();
        });
    });

CSS

   #rectangle {
  position: absolute;
  top: 226px;
  left: 691px;
  height: 561px;
  width: 996px;
  border: 1px solid red;
  opacity: .5;
}

.nav {
  position: relative;
  top: 25px;
  left: 1006px;
}

li {
  list-style-type: none;
  padding: 2px;
}

a {
  text-decoration: none;
}

.image-box {
  position: absolute;
  top: 226px;
  left: 691px;
}

.slider-nav {
  position: relative;
  top: 800px;
  left: 800px;
  display: -webkit-flex;
  -webkit-flex-wrap: nowrap;
  -webkit-flex-direction: row;
  -webkit-justify-content: center;
  -webkit-align-content: stretch;
  -webkit-align-items: stretch;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none
}

.nav-label {
  margin-left: 5px;
  position: relative;
  bottom: 2px;
  font-size: 10px;
  color: gray;
  white-space: nowrap;
  font-family: 'Brandon Grotesque', sans-serif;
  font-weight: 400;
  font-size: 10px;
}

.nav-spacing {
  position: relative;
  top: 5px;
  width: 1px;
  height: 26px;
  margin-left: 10px;
  margin-right: 10px;
  background-color: #d8d8d8;
}

.nav-dot {
  width: 10px;
  height: 10px;
  margin-right: 3px;
  margin-left: 3px;
  padding: 0;
  display: inline-block;
  border-radius: 10px;
  background-color: #E6E7E8;
  -moz-transition: background-color 0.3s ease-in-out;
  -o-transition: background-color 0.3s ease-in-out;
  -webkit-transition: background-color 0.3s ease-in-out;
  transition: background-color 0.3s ease-in-out
}

.nav-dot.select {
  border: 1px solid red;
}

.nav-dot:hover {
  border: 1px solid #202020;
}

Answer №1

I reached out for help on Stack Overflow, but unfortunately did not receive a response. However, I was able to find assistance on another forum to resolve my issue. If you're interested, you can read through the thread here

HTML

<body>
<div class="my-slider" id="group1">
    <ul>
        <li><img class="img-box" src="img/SampleImage.png"></li>
        <li><img class="img-box" src="img/SampleImage.png"></li>
        <li><img class="img-box" src="img/SampleImage.png"></li>
    </ul>
</div>
<div class="my-slider" id="group2">
...
...
  .first,
  .second,
  .third {
      padding-bottom: 5px;
  }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize Flexbox to create a layout with 3 divs, organized into two columns where one column

I am attempting to transform <div></div> <div></div> <div></div> Three consecutive divs into the following format. Div 1 is red, div 2 is green, and div 3 is blue. I have achieved this using floats, like so: .div1 { ...

Adjust the CSS to set the size of the element's height to a percentage of the screen

I'm curious if there's a way to set the CSS with an x (unknown) percentage amount, like height: *%;. If it's not possible, how can I make it take the size of the rest of the screen? I experimented in http://jsfiddle.net/omarjuvera/xnau2wsL/ ...

Using Struts2 to fetch data through AJAX and dynamically update a div element

Looking for advice on how to trigger an action class using JavaScript when a value is selected from a drop-down menu. The goal is to fetch data from a database and then update a table within a specific div without refreshing the entire page. The drop-down ...

Tips for Using jQuery ElevateZoom: Closing the Lens When the Mouse Reaches the Corner

I have an image that can be zoomed using the elevateZoom jQuery plugin. Next to this image, there are several links. When the user zooms in on the image and tries to click one of the links at the corner, they are unable to do so. Even when the mouse point ...

Passing state and handlers down through nested React components: A guide

I'm encountering an issue when trying to pass handlers down through my React components. I've attempted to follow the guidance provided in the Lifting State Up section of the React documentation. The concept involves having a Page with tabbed n ...

Tips for Making a JQuery Ajax Request Properly

Should I be chaining multiple Ajax calls together? While I understand that Ajax calls are asynchronous, I am faced with a situation where I need to initiate another call based on the success or failure of the first call. Here is an example snippet of cod ...

Issue with showing multiple images on HTML page

I'm currently working on enhancing my webpage by enabling the upload of multiple images. However, I'm facing challenges in figuring out how to obtain a valid URL for the image source and to verify if the correct number of files have been uploaded ...

The onUpdate function does not seem to be functioning as expected in the react-custom-scrollbars

In my React.js application, I am utilizing the "react-custom-scrollbars" component. My goal is to invoke a method each time a user scrolls. To achieve this, I have attempted using the onUpdate method. <div className="thumbs-panel"> <Scrollbar ...

Extracting the name of a track from the /r/listenToThis subreddit for an IFTTT automation script

I have a list of songs gathered from this subreddit, presented in the following format: [ "Lophelia -- MYTCH [Acoustic Prog-Rock/Jazz] (2019)", "Julia Jacklin - Pressure to Party [Rock] (2019)", "The Homeless Gospel Choir - I'm Going Home [Folk ...

Use an input to swap out a cube for a sphere in three.js

I need to switch the cube with a sphere of the same size, but when I try to add a function in JavaScript, the cube disappears. How can I adjust the dimensions of the cube? I am unsure how to connect the function modifie with the numeric inputs (length, w ...

Expanding jQuery menu that reveals a submenu if the current page is located within that specific submenu item

Currently, I am trying to enhance the functionality of this menu: http://jsfiddle.net/tz37m/1/ so that it works seamlessly across the entire website. My goal is to ensure that when a visitor is on a page within a submenu, that specific submenu remains open ...

Having difficulty in making the left sidebar stay fixed

In my web layout, I have a left-sided sideNav div and a right-sided main div set up as follows: #sideNav { background-color: #012d20; position: fixed; z-index: 1; top: 0; left: 0; overflow: hidden; border-right-style: groove; height: 100 ...

Issue with Flask app's template rendering when trying to search for a book

Currently, I am working on a Flask web application that has the functionality for users to search for books and view detailed information about them. However, an obstacle I am encountering is that the form does not get sent to the specified URL. Below is ...

Trouble arises when managing click events within the Material UI Menu component

I've implemented the Menu Component from Material UI as shown below - <Menu open={open} id={id} onClose={handleClose} onClick={handleClick} anchorEl={anchorEl} transformOrigin={{ horizontal: transformOriginRight, vertical: t ...

Bootstrap: Problem arises when columns do not total up to 12 and are pushed onto separate rows

So, I've been working with Bootstrap to structure columns and rows. It seems like I have the container, rows, and columns set up correctly for each post. However, I am puzzled as to why a new row is created for every post I make, causing them to stack ...

How can I vertically and horizontally center elements in the middle of a web page using ASP.NET and CSS?

Creating a basic web form can be easy. It must contain three lines of text/ASP.NET elements within a Master page that includes a header and footer. To ensure that these three lines are centered both vertically and horizontally on the page, especially whe ...

Use data attributes to automatically populate one form field with the information from another form field using jQuery

Within my Laravel 5 ecommerce website, I am attempting to automatically populate the values in the shipping_address form with the values from the billing_address form if the checkbox with name = same_as_billing is selected. I have been trying to utilize t ...

Expressing the challenge of CORS headers between Angular and Express

While everything was working fine in my development environment, I recently updated the code on my VPS and encountered an error in the console: "Access to XMLHttpRequest at 'https://www.example.con/api/register' from origin 'https://example. ...

Design a sleek and modern form using Bootstrap 4 that mirrors the aesthetics of the forms found in Bootstrap 3

Is there a way to create a form using BootStrap 4 that resembles the easily customizable forms from BootStrap 3? I am looking to have a bold, right-aligned label within a specific column size (e.g. col-sm-4), with an input field next to it whose width is c ...

Tips on how to make a <li> element float independently without impacting other elements on the page

I have a dilemma with two divs in my HTML code. One is designated for the menu, and the other is simply for the title. The issue arises when I attempt to float the <li> items next to each other within the menu; they end up shifting downwards from the ...