Cycle2 does not display the cycle pager

I am currently working on creating a slideshow for a website where the images slide automatically (which is functioning properly). I want to include round buttons below the slideshow for navigation, but unfortunately, the buttons are not showing up despite following the instructions from http://jquery.malsup.com/cycle2/demo/pager.php

This is my HTML setup:

<div class ="cycle-slideshow" data-cycle-fx="scrollHorz" data-cycle-timeout="5000" data-cycle-pager=".cycle-pager">

        <img src="http://jquery.malsup.com/cycle2/images/beach1.jpg">
        <img src="http://jquery.malsup.com/cycle2/images/beach2.jpg">
        <img src="http://jquery.malsup.com/cycle2/images/beach9.jpg">
    </div>
    <div class="cycle-pager"></div>

Here's my CSS styling:

    .cycle-pager { 
    text-align: center; 
    width: 100%; 
    z-index: 500; 
    position: absolute; 
    top: 10px;*
    overflow: hidden;
}
.cycle-pager span { 
    font-family: arial; 
    font-size: 50px; 
    width: 16px; 
    height: 16px; 
    display: inline-block; 
    color: #999999; 
    cursor: pointer; 
}
.cycle-pager span.cycle-pager-active { color: #D69746;}
.cycle-pager > * { cursor: pointer;}

.cycle-pager{
    width: 500px;
    height: 30px;
    margin-top: 517px;
}

And finally, my JavaScript code:

(function(){
    window.onload = function(){ //main
        $.getScript("/js/cycle2.js", null); //Handles the slideshow
        $.getScript("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js", null);

    }
})();

Answer №1

The issue at hand stems from the incorrect usage of the doctype declaration. It is recommended to use <!doctype html>

Answer №2

Here is a recommended JavaScript solution:

<Script type="text/javascript" src="jquery-2.1.4.min.js"></script>
<Script type="text/javascript" src="slick-carousel.min.js"></script>
<script type="text/javascript">
(function(){
    window.onload = function(){ //main
        $.getScript("/js/slick-init.js", null); //Handles the carousel
        $.getScript("http://ajax.googleapis.com/ajax/libs/jquery/3/jquery.min.js", null);

    }
})();
</script>

Answer №3

Give this a shot:

JSFiddle Example

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8>
    <title>New Document</title>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="http://malsup.github.io/jquery.cycle2.js"></script>

    <link rel="stylesheet" href="http://jquery.malsup.com/cycle2/demo/demo-slideshow.css">

</head>
<body>
    <div class="cycle-slideshow" data-cycle-fx="scrollVert" data-cycle-timeout="3000">
    <!-- placeholder for pager links -->
    <div class="cycle-pager"></div>

    <img src="http://jquery.malsup.com/cycle2/images/p5.jpg">
    <img src="http://jquery.malsup.com/cycle2/images/p6.jpg">
    <img src="http://jquery.malsup.com/cycle2/images/p7.jpg">
    <img src="http://jquery.malsup.com/cycle2/images/p8.jpg">
    </div>

</body>
</html>

Answer №4

Consider including the CSS property "height:40px;" in the .cycle-pager selector.

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

Having trouble populating two linked html dropdowns with JSON data using jQuery?

My attempt to populate two HTML selects with JSON data is resulting in an error: Uncaught TypeError: country.map is not a function when trying to populate the cities. Can anyone point out the issue with the code? $(document).ready(function() { let $co ...

Tips for creating a script that is compatible with both Java and C++

We currently offer both Java and C++ versions of our distributed messaging system product. I am in the process of developing a framework to conduct system testing across multiple servers. In order to accomplish this, I need a "test coordinator" process th ...

JavaScript-enhanced HTML form validation

I encountered a small glitch while working on simple form validation with JavaScript. I tried to catch the issue but have been unable to do so. Here is the code snippet, where the problem lies in the fact that the select list does not get validated and I ...

Creating a responsive Image for desktop screens with the help of Tailwind and nextJS

I'm currently working on a component that displays a set of images with horizontal scroll. The challenge I'm facing is setting different dimensions for mobile/tablet screens and desktop screens. For mobile and tablet, I want the images to be disp ...

Adding dynamic properties to an object on the fly

When working in Javascript, I defined an object as follows: this.view.objectExample.accessibilityConfig= { 'propertyA': 1, 'PropertyB': 2, 'PropertyC': 3 }; I attempted to add a new property during runtime but enc ...

I am struggling to comprehend the data organization illustrated by the typescript type declaration

type DocumentData = { [field: string]: any }; let data1: DocumentData = {4:3}; console.log(data1); //{4:3} It appears that the DocumentData type in the code above defines an object type where the key is of string type and the value can be of any type. Th ...

Slide the next section over the current section using full-page JavaScript

I'm currently developing a website utilizing the FullPage.JS script found at this link . My goal is to have the next section slide over the previous one, similar to what is demonstrated in this example. I've attempted setting the position to fix ...

Creating artistic designs on an item with Three.js

My goal is to use the mouse to paint on the surface of objects. For inspiration, check out this example: Can anyone provide a basic example of how to achieve this? I believe the process involves painting on a canvas and then applying it to the 3D object ...

The announcement will not be made as a result of the utilization of a private name

I've been working on transitioning a project to TypeScript, and while most of the setup is done, I'm struggling with the final steps. My goal is to use this TypeScript project in a regular JavaScript project, so I understand that I need to genera ...

Is there a way to retrieve the final word following a unique character?

Currently, I have this: \- (.*) When analyzing the text below: September 2014 - Media I am trying to extract "Media", but instead I am retrieving "- Media" ...

Troubles with Vue and localStorage for storing a theme's data

I've been struggling with this issue for a while now while working on a Vue site. I have not been able to find a solution for my specific bug in other discussions. The concept should be straightforward - I want to have a switch that toggles a value b ...

Encountering problems with ajax technology

As a newcomer to Laravel and Ajax, I am facing an issue with displaying the state of the selected country in a dropdown list. Although the data is successfully fetched from Laravel and received through Ajax, I am struggling to dynamically add it to the H ...

How can I utilize regex to change the background color of a specific character in a react/typescript application?

One of my components contains mapped data, and I've been tasked with changing the background color of specific characters, namely "Miss", "Mrs", and "Ms". I've attempted to use regex, but I keep encountering an error that the object is possibly n ...

Three.js failing to display objects

I am currently developing a project using modular Three.js with TypeScript. Although the scene is being created successfully, I am facing an issue where no elements are being rendered on the canvas. Below is the snippet of my code: import * as THREE fro ...

Guide to creating a vertical handler that can be resized

Did you know that you can resize tables in http://www.jsfiddle.net? I'm curious about how to resize just the "Vertical Handler". Could someone share the source code with me? If possible, please provide an example on http://www.jsfiddle.net. ...

Can anyone share a straightforward yet practical demonstration of using jquery.JsPlumb?

In my quest for a reliable graph-visualization JavaScript library, I recently came across jsPlumb at http://jsplumb.org. The examples I've seen truly showcase its advanced capabilities and attractive design. However, despite the extensive documentatio ...

Developing a Customized Styling Guide Using Node.JS and User Specifications

Seeking a method to generate a personalized user style sheet utilizing input from users. Users can choose options like background colors, and the app will generate a custom style sheet based on their selections. Their input will be captured through HTML in ...

Issues with 'Backspace' and 'Clear' buttons on HTML calculator preventing proper function in JavaScript

Hello everyone! I've recently started working on a pure HTML/CSS/JS calculator project. While the HTML and CSS parts went smoothly, I'm facing some issues with getting the initial functions to work properly. Despite doing some research online, I ...

Deleting an item from a Vue.js list

I'm currently working on a project to develop a basic webpage that allows users to add or remove textboxes using vue.js. new Vue({ el: "#app", data() { return { list: [] }; }, methods: { deleteFromList(index) { this ...

Using React Native to showcase a background grid of dimensions {height: 10, width: 10}

Hey there! I'm looking to create a grid that can adapt to different device sizes and screen positions, similar to a chess grid. I want to use this as a background to help with sizing and positioning elements like text and images on the screen. Here&a ...