Position the previous and next buttons next to the thumbnail images

I've implemented the cycle2 jQuery plugin on my website successfully, but I'm facing an issue with positioning the prev and next buttons next to my thumbnails. I want them to be aligned with the first and last thumbnail without relying on absolute positioning for responsiveness. Is there a way to achieve this alignment consistently?

Below is the code snippet in question:

Thank you in advance for your help!

<div id="main">
    <script src="http://malsup.github.io/jquery.cycle2.carousel.js"></script>
    <script src="http://malsup.github.io/jquery.cycle2.tile.js"></script>

    <div class="row">
        <div class="container">
            <div class="col-md-12">
                <div id="slideshow-1">

                    <div id="cycle-1" class="cycle-slideshow" data-cycle-slides="> div" data-cycle-timeout="0" data-cycle-prev="#slideshow-1 .cycle-prev" data-cycle-next="#slideshow-1 .cycle-next" data-cycle-caption="#slideshow-1 .custom-caption" data-cycle-caption-template="Slide {{slideNum}} of {{slideCount}}" data-cycle-fx="tileBlind">
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                        <div>
                            <img src="images/slider.jpg" class="img-responsive slideshow-img">
                        </div>
                    </div>
                </div>

                <div id="slideshow-2">
                    <div id="cycle-2" class="cycle-slideshow" data-cycle-slides="> div" data-cycle-timeout="0" data-cycle-prev="#slideshow-2 .cycle-prev" data-cycle-next="#slideshow-2 .cycle-next" data-cycle-caption="#slideshow-2 .custom-caption" data-cycle-caption-template="Slide {{slideNum}} of {{slideCount}}" data-cycle-fx="carousel" data-cycle-carousel-visible="5" data-cycle-carousel-fluid=true data-allow-wrap="true">
                        <a href="#" class="cycle-prev">&laquo; prev</a>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <div>
                            <img src="images/robin-thumb.jpg" width=100 height=100>
                        </div>
                        <a href="#" class="cycle-next">next &raquo;</a>
                    </div> <!-- end of cycle 2 -->
                </div> <!-- end of slideshow 2 -->
            </div> <!-- end of col md 12 -->
        </div> <!-- end of container -->
    </div> <!-- end of row -->

Current display:

Answer №1

For a better user interface, remember to include float:left and float:right in the next and prev elements:

<a href="#" class="cycle-prev" style="float: left;">« prev</a>
<a href="#" class="cycle-next" style="float: right;">next »</a>

You can find the working code here: http://jsfiddle.net/zjvka30q/3/

Check out the updated code for an enhanced user experience!

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

Connecting Next.js to a Database: A Step-by-Step Guide

I am interested in developing an application similar to Samsung Health that will involve heavy querying on a database. I am unsure whether it would be more beneficial to create a custom server using Node.js (with Express.js) instead of using the integrate ...

Replace all occurrences of $regex in Node.js with the json data format

Here is a JSON example var json= { name: { '$regex': /^Amer$/i }, 'countries.name': { '$regex': /^UNited states$/i } } I am looking to reformat it using either lodash or string/json replace method to achieve the following st ...

The inclusion of a content editable feature within a carousel is leading to unexpected event propagation

I am dynamically creating an editable div using the code snippet below. <div class='reflection-field' contenteditable="true" data-number="${index}"></div> Expected Outcome: When I click on the generated div, I anticipate that the c ...

Shopping with Jquery just got easier! Our innovative ajax cart feature now allows you to shop and easily checkout with

Good day, everyone. I am currently working on implementing a shopping cart feature using jQuery and Ajax. The code seems to be functioning well for one product row; however, when I try to adjust the quantity for the second product row, the calculation does ...

Utilizing Vue to link data to an input field

I am struggling with a loop of input elements <li v-for="role in ..."> {{-some html-}} </li> Each input is nested inside the loop as shown below <input type="text" :data-some="role.name" :value="role.name" name="name" ....> While ...

NextJS application failing to display SVG icon in the absence of internet connection

https://i.stack.imgur.com/M9reE.jpg https://i.stack.imgur.com/Yyg4g.jpg Upon inspection of the provided images, it is evident that the src URL points to a location within the nextjs public folder. The issue arises when there is no internet connection - i ...

The function cannot be accessed during the unit test

I have just created a new project in VueJS and incorporated TypeScript into it. Below is my component along with some testing methods: <template> <div></div> </template> <script lang="ts"> import { Component, Vue } from ...

The HTML5 Canvas ellipse with a thick line width is displaying a quirky blank space

I am currently working on a drawing application using HTML5 canvas. Users have the ability to draw ellipses and choose both line and fill colors, including transparent options. Everything works smoothly when non-transparent colors are selected. However, ...

Customize the text color across all sections of the application in ExtJS 6

I am looking to update the text color across my entire application. Currently, it's gray and I would like to change it to black. The platform I am working with is classic. I came across this code snippet in CSS: .x-body { margin: 0; -webkit-f ...

Error encountered while trying to eliminate array element

I have a project in the works that involves creating a page where users can filter suggestions and vote for their favorites. The screen is divided into 3 tabs: [Top Rated], [Newest], and [My Votes]. Upon loading the screen, a call to the database is made ...

Incorporating text sections into a div container and adjusting the width

Currently facing an issue with the canvas element on my project. <div id="app-container"> <div id="canvas-container"> <div id="canvas"></div> </div> </div> In the CSS stylesheet, the following styles ar ...

Determine using Javascript or jQuery whether the value of input1 is greater than the value of input2

Ensuring that Value1 is always greater than Value2 in a form submission is crucial. If Value1 becomes greater than or equal to Value2, an error message should be displayed and the form submission should not be processed. Below is the code for the form: & ...

Incorporating outside content into HTML

Currently, I am working on a project at my job which requires me to create a comprehensive help file with multiple chapters and extensive text all within one large HTML file. However, as the text will need to be translated into different languages, I am lo ...

When an image in AngularJS is clicked, it should display a corresponding list

I'm brand new to Angular development. This is my very first solo project. My goal is to design a page where clicking on an image will display a list of items below it. For example, check out this link for reference: I've searched online for so ...

React - Image Uploader exclusively accepts images with transparent backgrounds

I need to verify if an image has a transparent background and reject it if it does, but accept it if it doesn't. However, I am facing an issue where the hasAlpha function is not triggering an 'error' alert when the image contains a backgroun ...

Utilizing pseudo elements (after) in CSS with the font family in Font Awesome 6 fails to function properly

I am attempting to create the div using CSS after pseudo-element and I have included the Unicode in the content with the font family being "Font Awesome 6 Free". However, nothing is showing up and I'm not sure why. Can someone please assist me? Here i ...

Obtaining Data from PHP using jQuery AJAX

Currently utilizing the ajax function in Jquery to retrieve values from a PHP script using the json_encode function. However, the data being returned is riddled with slashes, quotes, and \r\n. It appears that there may be an issue with stripslash ...

Tips for aligning text to the left within a Bootstrap accordion

I am in the process of developing a static website utilizing the W3schools "Company" theme. The complete code for this website, including CSS, is provided below: <!DOCTYPE html> <html lang="en"> <head> <!-- Theme Made By www.w3schoo ...

Just encountered an issue stating "PrismaClient cannot run in the browser" while working with [Next.js]

My initial plan was to log all the IDs of news in my database using console. However, when I executed the code, an error occurred as shown in this image. What is the best way to address and resolve this issue? https://i.stack.imgur.com/ci8G1.png ...

Guidelines on declining a pledge in NativeScript with Angular 2

I have encountered an issue with my code in Angular 2. It works fine in that framework, but when I tried using it in a Nativescript project, it failed to work properly. The problem arises when I attempt to reject a promise like this: login(credentials:Cr ...