Utilizing jQuery, a captivating slideshow showcasing a series of images elegantly emerges from the center-right of

I've been working on creating a slideshow of images and I came across this tutorial:

After downloading the zip file and getting started, everything was working fine. The only issue I encountered was trying to position those four dots at the bottom right corner of the image, right in the center along the border.

An example of what I'm looking for can be seen here:

If you look at the image above (not showing full image), you'll notice that all the dots are arranged vertically instead of horizontally, positioned at the right center of the image. I want to achieve something similar. Is this possible?

I tried using the margin-top property but it didn't work as expected.

Update:-

The CSS responsible for displaying the four dots image is where I made an attempt by adding margin-top, but it still didn't work:

.slidesjs-pagination li a {
  display: block;
  width: 13px;
  height: 0;
  padding-top: 13px;
  background-image: url("https://s16.postimg.org/pt4k43i9x/pagination.png");
  background-position: 0 0;
  float: left;
  <!-- added by me-->
  margin-top: -50px; 
}

Here is the entire HTML code:

<!doctype html>
<html>
<head>
... (omitted for brevity)
</script>
  <!-- End SlidesJS Required -->

  <!-- SlidesJS Required: Link to jquery.slides.js -->
  <script src="js/jquery.slides.min.js"></script>
  <!-- End SlidesJS Required -->

  <!-- SlidesJS Required: Initialize SlidesJS with a jQuery doc ready -->
  <script>
    $(function() {
      $('#slides').slidesjs({
        width: 940,
        height: 528,
        navigation: false
      });

      /*
        To have multiple slideshows on the same page
        they just need to have separate IDs
      */
      $('#slides2').slidesjs({
        width: 940,
        height: 528,
        navigation: false,
        start: 3,
        play: {
          auto: true
        }
      });

      $('#slides3').slidesjs({
        width: 940,
        height: 528,
        navigation: false
      });
    });
  </script>
  <!-- End SlidesJS Required -->
</body>
</html>

Answer №1

To position the menu absolutely on the right side, set a value for right to create space between the menu and the edge, then center it. Finally, remove the floating property from the li elements.

#slides {
  position: relative;
}
#slides .slidesjs-pagination {
  position: absolute;
  top: 50%;
  right: 1em;
  transform: translateY(-50%);
  z-index: 9999;
}
#slides .slidesjs-pagination li {
  float: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slidesjs/3.0/jquery.slides.min.js"></script>
<!doctype html>
<html>
<head>
...
    });
  </script>
  <!-- End SlidesJS Required -->
</body>
</html>

Answer №2

Below is the updated CSS with new styles:

#carousel {
    position: relative;
}
.carousel-pagination {
    margin-top: 6px;
    float: none;
    list-style: none;
    position: absolute;
    top: 50%;
    right: 30px;
    z-index: 100;
    transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
}
.carousel-pagination li {
    float: none;
    margin: 0 1px;
}

.carousel-pagination li a {
    display: block;
    width: 13px;
    height: 0;
    padding-top: 13px;
    background-image: url(https://s16.postimg.org/pt4k43i9x/pagination.png);
    background-position: 0 0;
    float: left;
    overflow: hidden;
}

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

Attempting to enhance my show/hide DIV code to efficiently target multiple divs

Currently, I am faced with a challenge involving a lengthy case study that includes numerous images. The loading time for the page is exceptionally long due to the high number of images. To address this issue, I have implemented a method using show and hid ...

Is it possible to execute user-defined functions dynamically in a Node.js application without having to restart the server

I am exploring the potential for allowing users to insert their own code into a Node application that is running an express server. Here's the scenario: A user clicks 'save' on a form and wants to perform custom business validations. This ...

What is the best way to add an element from a parent component to an array within a child component in a Vue 3 application?

I am in the process of transitioning from Vue's Options API to the Composition API, and as part of this transition, I have built a small Todo App. Within App.vue, my code looks like this: <template> <div id="app"> <div ...

putting a division element above a image carousel

Is there a way to overlay a div tag on top of a slideshow, similar to the one shown in this link? In the example provided, a div with the title "DISCOVER THE JOY OF COOKING" is positioned over a slideshow. Any tips on how I can achieve this effect? ...

Choosing an item from a list using React-Redux

Currently learning React, I am facing some challenges in selecting an item from a list of recipes. My main focus right now is on deleting a recipe from the list, but before that, I need to understand how to identify and select a specific recipe. For refer ...

Encountering an NPM ELIFECYCLE error when attempting to start the node server with the

After following the instructions on deploying test-bot on IBM Watson from this link https://github.com/eciggaar/text-bot, I encountered errors while attempting to deploy the code locally using CLI foundry. My setup includes Node.js version 6.10.3 and npm ...

Encountering issues with React context API where the state is being set to undefined

I've recently delved into the world of React and have been utilizing the context API to manage my global state. Within the MyProvider.js file, I create a provider that simply holds 2 arrays of JSON objects. import {MyContext} from "./MyContext"; imp ...

What is the best way to ascertain the variance between two Immutable.js Maps?

I currently have two unchangeable maps: const initial_map = Map({x: 10, y: 20)} const updated_map = Map({x: 15, y: 20)} Can anyone advise on how to find the changes between the two maps? The expected outcome should be: Map({x: 15}) ...

Get a calendar that displays only the month and year

I am looking to incorporate two unique PrimeFaces calendars on a single page. The first calendar will display the date, while the second one will only show the month and year. To achieve this, I have implemented the following JavaScript and CSS specifica ...

"Master the art of implementing a slide toggle effect with jQuery UI using

Looking to implement the jQuery UI slide toggle functionality in plain JavaScript... <center> <button id="button" class="myButton">Read More</button> </center> <div id="myDiv"> <p>Cool Read More Content Here. Lorem Ips ...

How Python Flask sends a string as &#34 to an HTML page

I am working on a Flask app and I need to send simple JSON data from the app.py file to an HTML page. Here is the relevant code in my app.py: jsonArr = [{"type": "circle", "label": "New York"}, {"type": "circle", "label": "New York"}] return ...

Transferring items between different containers without using innerHTML

I've got an embedded <ul> within a (hidden) <aside id="idDetails">. How can I move the ul element from inside the aside and position it in a <div id="projectSide"> without using innerHTML? Any solutions in both plain JavaScript and j ...

Using Django to add JSON data to the request.Post object

I need to insert my JSON object into the Django request Here is my HTML code: <form method="post" action="/IE/changePassword/" > <table> <tr> <td><h4>Mobile Number : </h4></td> <td><inp ...

Overflow of dropdown menus in HTML CSS

Hello, I am new to both html and stack overflow. Please forgive me if this question has already been asked, as I couldn't find anything (but maybe I didn't search enough?). I have tried using overflow and clear properties, but I am struggling to ...

When do you think the request is triggered if JSONP is essentially a dynamic script?

It appears that JSONP requests made using jQuery.ajax are not truly asynchronous, but rather utilize the Script DOM Element approach by adding a script tag to the page. This information was found on a discussion thread linked here: https://groups.google.co ...

selection menu and advancement gauge

While working on my code, I have a task where I need to make the progress bar move a specific amount when a name is clicked based on the option's value. <!DOCTYPE html> <html> <head> <title>testinggg</title> &l ...

The CSS of the Sendgrid template is being overlooked

I have utilized Sendgrid to create the template mentioned below: https://i.sstatic.net/TFQfl.png In order to send this template using my Node server, I have developed the module provided in the code snippet: /* * Created by root on 6/6/16. */ var path ...

Outcome of Request.Form when the input requested is empty

What can I do when Request.Form("myInput") is blank and causes a server error? Any suggestions on how to address this issue? Is there a method to verify if "myInput" has not been populated? ...

When the disk space is insufficient, the createWriteStream function will not trigger an error event if the file is not completely written

One challenge I'm encountering involves using createWriteStream: Imagine I have a large 100mb file that I want to write to another file on the disk. The available space on the disk is only 50mb. Here's my code snippet: const fs = require(&a ...

Animating text with jQuery for creative writing

Please check out this fiddle, My attempt was to design an animation where a div glides in, followed by text appearing character by character. I am aiming for a smoother writing effect rather than the current typing effect I have achieved. Does anyone kn ...