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

Use PHP code to echo a clear division after every third result in MySQL

I am currently displaying results in descending order from a MySQL table using a while loop. I have already set up a pagination system that displays 9 records per page. However, I am facing an issue when trying to implement a CSS break every 3 records in ...

Adding double quotes to arrays in D3.js after using the .map method

Here is the code snippet I am working with: d3.csv("static/data/river.csv", function(data) { var latlongs = data.map(function(d) { return [d.Lat,d.Lng]; }) var lineArray1 = latlongs; console.log(lineArray1); When I view the outpu ...

Process JSON data from an input using Javascript

I am encountering an obstacle at the final step of my data flow process. Currently, I am in the midst of developing an application that retrieves input from an HTML form field and utilizes Ajax to fetch data relevant to the user's input. Allow me to e ...

Can a sophisticated text editor be utilized without a content management system?

Many website builders utilize rich text editors as plugins to enhance content creation, such as in CMS platforms like Joomla and WordPress. However, can these same editors be easily integrated into a custom website built from scratch using just HTML, PHP ...

React is indicating that returning functions is not appropriate as a React child. This issue may arise if you accidentally return a component instead of <Component /> within the render method

Check out the main game.js and app.js files: //Here is the code in game.js// import React, { Component } from "react"; class Game extends Component { constructor(props) { super(props); this.state = { num: 0 }; this.numPicker = this.numPi ...

Ways to Enhance jQuery Efficiency in a Broader Sense

Utilizing jQuery functions is a common practice for us. However, there has been talk about its impact on performance. While it is simple to write, understand, and maintain, some say that it is slower compared to using traditional raw JavaScript code. But ...

Is there a way to narrow down the font choices using HTMLPurifier?

- Currently in my project, I have incorporated an HTML-WYSIWYG Editor that allows users to utilize various Webfonts for styling their texts. The editor I am utilizing can be found at NiceEdit. It generates code snippets such as: <font face="c ...

My API is feeding data to the Material UI CardMedia image

Has anyone encountered a similar error while using the CardMedia API provided by Material-UI? I am currently utilizing the Card & CardMedia components from material-ui to display data fetched from an api. However, I am facing difficulty in displaying ...

What could be the reason for scrapy not returning any URLs?

Recently, I attempted to develop a tool to simplify my apartment search and access relevant information quickly (the website is not very user-friendly). However, I have encountered an issue and I may be overlooking something obvious...or perhaps I'm j ...

Is it possible to populate a jQuery auto complete field with values that are chosen from a different jQuery autocomplete field beforehand?

Currently, I am implementing jQuery UI's auto complete feature in my form. The form consists of two sections - the second section is displayed only after submitting the first one. In the second section, I need to pre-populate another auto complete fie ...

I designed my higher-order component to allow for dual invocations. How can I integrate Redux within this framework?

I have implemented my higher-order component (HOC) in such a way that it can be invoked twice, emphasizing the concept of "functional programming". However, I am facing challenges in connecting Redux to access state and certain functions. I would greatly ...

Deactivate web security for JavaScript with Watir

While using Watir, I have the ability to access the methods of the iframes on the page: browser.iframes.map(&:contentwindow) # => ["", "", ""] However, if I try to access the iframes using JavaScript within the same context where I executed the W ...

JavaScript - Executing the change event multiple times

Below is the table I am working with: <table class="table invoice-items-table"> <thead> <tr> <th>Item</th> <th>Quantity</th> <th>Price</th> & ...

Persistent error caused by unresponsive Tailwind utility functions

Currently, I am working on a Next.js application and encountered a strange error while adjusting the styling. The error message points to a module that seems to be missing... User Import trace for requested module: ./src/app/globals.css GET /portraits 500 ...

Guide to executing CRUD operations on a list through buttons and displaying each outcome in a popup window

I'm encountering a problem with my MVC Application: Here is my Controller: public class EmployeeController : Controller { // // GET: /Employee/ static EmpUser obj = new EmpUser(); public ActionResult Index() { return View( ...

Steps for updating a text section beneath a carousel

I'm looking to enhance my webpage with a bootstrap carousel, which is pretty standard. However, I want the content under each slide to change dynamically, but I'm struggling to make it work. As a newbie, I could use some guidance. I've atte ...

What is the proper way to showcase an element positioned absolutely within a Dialog window using material-ui?

My current project involves using React, TypeScript, StyledComponent, and MaterialUI. I am looking to add a button to a Dialog window (material-ui) similar to the design shown in this example image. However, when I apply position: absolute to the button, ...

Align Headers to the Top Center in React Material-UI Datagrid

Is there a way to align the wrapped headers at the top-center using sx? I've tried the following code: const datagridSx = { '& .MuiDataGrid-columnHeaders': { height: 'unset !important', maxHeight: '168p ...

A step-by-step guide to displaying API data in a React frontend using functional components

I've managed to create a backend API using Node+Express+MSSQL and tested the routes with POSTMAN. However, I'm facing challenges when trying to display the data on the front-end using React Functional components/hooks. I'm unsure if I'm ...

Unable to identify the element ID for the jQuery append operation

After attempting to dynamically append a textarea to a div using jQuery, I encountered an issue. Despite the code appearing to work fine, there seems to be a problem when trying to retrieve the width of the textarea using its id, as it returns null. This s ...