Plugin for jQuery that paginates text when it overflows

Looking for a solution here. I have a fixed width and height div that needs to contain text. If the text exceeds the size of the div, I want it to paginate with dots at the bottom of the page indicating each page, similar to slideshow functionality.

Are there any jQuery plugins out there that can help me achieve this? The ones I've come across are all based on un-ordered lists which isn't what I need. Scroll bars are not an option for me.

Appreciate any suggestions. Thanks!

Answer №1

Here is a helpful solution in the form of a small fiddle that addresses your needs. Some styling may be required, but the core functionality is already in place.

This code determines the number of pages based on the viewport size of the div and the height of the text. It then generates an unordered list for easy navigation.

By clicking on any item in the list, the corresponding page will be scrolled to within the fixed outer div by multiplying the index with the viewport height.

Check out the fiddle here

I trust this will be beneficial for you :).

Answer №2

While there may not be an existing plugin that specifically addresses this issue, a potential solution could involve breaking the text into chunks based on either character or word count. These chunks could then be placed in separate divs for use in a slideshow.

It's important to note that this method may not be precise due to variations in word wrapping, so adjustments may need to be made accordingly. Despite this limitation, it provides a starting point for addressing the problem at hand.

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

Issue with Vue.js 2: Image tag disappears following re-render when fetching data from the server

Working with vuejs in my project was going fine until I encountered this issue: on my page, I have a data grid with an image carousel called "Owl carousel" and the code looks like this: fetchData: async function () { let self = this let query = se ...

Issue with Bootstrap 4 Dropdown Menu not directing to specified href destination

Project URL: You can download the file by clicking on "Download bootstrap menu file for testing" I have implemented a Bootstrap 4 hover menu that works fine on desktop, but on mobile devices, it converts to a clickable menu. Everything is functional so ...

The surprising way Next.js disabled the production build and transformed my rgba color into hsla

I created CSS code to display grid patterns like this: background-image { repeating-linear-gradient( 0deg, rgba(255, 255, 255, 0.43) 0px 1px, transparent 1px 20px ), repeating-linear-gradient( 90deg, rgba(255, 255, 255, 0.43) 0px 1px, transparent 1px 20 ...

Adding event listeners to elements created dynamically

I am facing an issue with some dynamically generated divs from a JavaScript plugin. The divs have a class .someclass which wraps existing divs. My goal is to add a class to the children of .someclass. I attempted to achieve this by using the following code ...

Invoke data-id when the ajax call is successful

Initially, there was a smoothly working "like button" with the following appearance: <a href="javascript:void();" class="like" id="<?php echo $row['id']; ?>">Like <span><?php echo likes($row['id']); ?></span ...

What's the best way to update the menu element colors as I scroll down the page?

I am looking to update the color scheme of menu elements as the page scrolls using the provided template. I tried a few methods, but they lack dynamism. How can I make it more dynamic? $(document).ready(function(){ //scroll animation $('.navigati ...

Can an if-statement be utilized in an Ajax scenario?

I'm currently developing a web application that enables users to post messages on a page. There are two ejs files involved in this process: index.ejs contains the form for users to input information and displays a list of usernames and messages re ...

Ways to show alternative data from a database in Laravel 8

I am working on a project where I need to display additional data based on the option selected from a dropdown menu populated from a database. Can anyone guide me on how to achieve this using javascript or jquery? https://i.stack.imgur.com/k3WLl.png Belo ...

The Feedback Form jQuery is not providing any data

I'm facing an issue with my html page that includes an ajax query to a php file. The purpose of this php file is to send a message and then return a response to the ajax query. However, no matter what I try, I am unable to receive any response from th ...

The overlay on the mobile device is too large for the screen

I've designed a basic div overlay using the CSS code below: position:absolute; top:0; left:0; display:none; cursor:default; z-index:101; width:100%; height:100%; To show the overlay, jQuery is utilized. Everything works perfectly on desktop browsers ...

What is a PHP self-generating variable?

Is it possible to use a form variable as its own URL? It may be difficult to explain, but here's an example: matchmaking.php: $search_summoner = $_POST['search_summoner']; echo '<form method="post" action="matchmaking.php?searc ...

When resetting the function, make sure to move the class to the closest sibling element

I am currently utilizing a slider that employs the .prev and .next jQuery functions to toggle the active class, indicating which slide is being displayed. Here is the code responsible for this functionality. It identifies the current sibling with the acti ...

In search of the HTML code for the forward button when extracting content from a webpage

While using Power Automate Desktop to scrape a webpage, I encountered an issue with clicking the next button. Even after copying the HTML code within the developer tools of the webpage, I found that both the previous and next buttons had the same path, mak ...

Dealing with pesky table cell padding issues in Chrome

Struggling with table cell paddings in Chrome because it appears that if a table cell doesn't have pure text, the padding isn't applied. Here's my code: <table> <tr> <th></th> <th ...

Creating Event Handlers for corresponding elements in HTML with the help of JQuery and JavaScript

Struggling with HTML and debugging an issue in my ASP.NET Core App. The problem lies in a CSHTML view that functions as a timeclock system for tracking user input against job numbers. The current Index.cshtml is operational, verifying JobNumbers against t ...

What is the method to restrict the coverage of the background color within a specific region in HTML?

I am still fairly new to html so I apologize if this is a very basic question for you. Here is the css file that is causing me trouble: .sidepanel-list{ margin-left: 10px; background-color:lightgray; Whenever I run the code, the background color s ...

Serialization in .NET and the weekcalendar: events that are not defined

I've been attempting to integrate the jQuery weekcalendar within a .net environment. The issue I'm encountering is that after making an ajax call to a custom webmethod that returns JSON, the weekcalendar plugin reports that events.events is undef ...

What is the best way to fill a Kendo grid using Ajax?

On my webpage, I have a grid that I want to populate with the results from an Ajax function. However, I am struggling to implement this correctly and could use some guidance. I have looked at various examples, but I am unsure how to adapt them to fit my sp ...

Error Event Triggered by AJAX with No Response Data

I am currently facing an issue with an API call I am making. Everything seems to be working fine as I receive the token and a status code of 200 is returned (confirmed in Fiddler). However, the problem arises when the AjaxError event fires and the respon ...

issue with duplicating DOM element using function

My situation is unique from the one described in this post. The code mentioned there is not functioning as expected when clicking the clone button. I have even provided a video explanation of how that code works. Unfortunately, I haven't received any ...