endless cycle of scrolling for div tags

My goal is to incorporate a tweet scroller on

I believe it uses the tweet-scroller from

Unfortunately, this link seems broken as the demo is not functioning.

I searched for an alternative solution and came across http://jsfiddle.net/doktormolle/4c5tt/

Here is the HTML code:

<ul class="slide">
  <li><img src="http://www.google.com/logos/2010/canadianthanksgiving2010-hp.jpg"/></li>
  <li><img src="http://www.google.com/logos/2010/germany10-hp.gif"/></li>
  <li><img src="http://www.google.com/logos/stpatricks_02.gif"/></li>
</ul>

CSS:

 ul.slide{margin:0;
      padding:0;
      height:80px;
      list-style-type:none;}
 ul.slide li{float:left;
         list-style-type:none;}
 ul.slide img{border:1px solid silver;
         height:80px;}

JS:

 //Plugin start
(function ($) {
    var methods = {
     init: function (options) {
         return this.each(function () {
             var _this = $(this);
             _this.data('marquee', options);
             var _li = $('>li', _this);

             _this.wrap('<div class="slide_container"></div>')
                 .height(_this.height())
                 .hover(function () {
                         if ($(this).data('marquee').stop) {
                             $(this).stop(true, false);
                         }
                     },
                     function () {
                         if ($(this).data('marquee').stop) {
                             $(this).marquee('slide');
                         }
                     })
                 .parent()
                 .css({
                     position: 'relative',
                     overflow: 'hidden',
                     'height': $('>li', _this).height()
                 })
                 .find('>ul')
                 .css({
                     width: screen.width * 2,
                     position: 'absolute'
                 });

             for (var i = 0; i < Math.ceil((screen.width * 3) / _this.width()); ++i) {
                 _this.append(_li.clone());
             }

             _this.marquee('slide');
         });
     },

     slide: function () {
         var $this = this;
         $this.animate({
                 'left': $('>li', $this).width() * -1
             },
             $this.data('marquee').duration,
             'swing',
             function () {
                 $this.css('left', 0).append($('>li:first', $this));
                 $this.delay($this.data('marquee').delay).marquee('slide');

             }
         );

     }
     };

     $.fn.marquee = function (m) {
     var settings = {
         'delay': 2000,
         'duration': 900,
         'stop': true
     };

     if (typeof m === 'object' || !m) {
         if (m) {
             $.extend(settings, m);
         }

         return methods.init.apply(this, [settings]);
     } else {
         return methods[m].apply(this);
     }
 };
 })(jQuery);

 //Plugin end

 //call
 $(document).ready(
 function () {
     $('.slide').marquee({
         delay: 3000
     });
 }
 );

With some minor modifications, this solution works fine. Here's the modified version: http://jsfiddle.net/3pZwR/1/

The only issue is that it stops after each div is scrolled.

I am seeking an infinite scroll effect without interruptions, similar to what is seen on HubSpot.

Answer №1

Consider utilizing a different JQuery Easing technique rather than "swing". Explore the various Easings available on the JQuery website: http://api.jqueryui.com/easings/

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

Trouble with loading images on hbs/nodejs

I'm currently working on a web application using NodeJs and express-handlebars. However, I am facing an issue with images not displaying correctly on the HTML page that is being rendered using handlebars. Here is the structure of my app: The root fo ...

converting HTML values to TypeScript

I'm a beginner with Angular and could use some assistance. Currently, I have two components - one for the index and another for navigation. Within the index component, there are subcomponents that change based on the value of a variable called produ ...

How come the HTML page served by the express.js route isn't linked to a CSS stylesheet?

Recently, I've been working with a server.js file that imports a router const path = require("path"); const express = require("express"); const app = express(); const PORT = 8080; app.use(express.urlencoded({ extended: true })); app.use(express.jso ...

The Rails base file contains a function, let's call it function A, which calls another function, function C. However, function C is defined in two separate JavaScript files

My project includes an application_base.js file with a function: function drawLocations(canvas, blag, blah) { //do some stuff selectLocations(a_something, b_something); //do some stuff } For Page 1: page_1.js function selectLocations(a_somet ...

Encountered an npm compilation error - Unable to locate module: bootstrap-theme.css

I recently updated all the dependencies in my JavaScript program without making any changes to my components or index.js file. However, when I run npm run build I encounter an error with index.js related to bootstrap-theme.css: Failed to compile. Modul ...

Vue.js / Nginx / Node.js - Error 413: Payload Too Big

My frontend is built using Vue.js and is hosted on an nginx server in production. Here's a snippet of my nginx.conf configuration: server { listen 80; server_name localhost; root /usr/share ...

Efficiently handling multiple responses in Express.js per single request

Currently exploring Node.js and working on a bot utilizing Dialogflow. I am aiming to establish a straightforward process: Step 1: Dialogflow sends a POST request with parameter param1 Step 2: My application replies with a waiting message (e.g., "your re ...

In PowerShell, use the "ConvertTo-Html" commandlet to incorporate

I have a script that retrieves data from a server, converts it to HTML, and then sends the report via email. Here is a snippet of the script: $sourceFile = "log.log" $targetFile = "log.html" $file = Get-Content $sourceFile $fileLine = @() foreach ($Line i ...

What is the best method for seamlessly loading JSON data while transitioning between pages in a jqtouch application?

I've been working with JQTouch for my application. While the demos showed how to retrieve an html file and display it in the user interface, I'm dealing with loading JSON data that I want to incorporate into an existing DIV element. I prefer not ...

My Angular Router is creating duplicate instances of my route components

I have captured screenshots of the application: https://ibb.co/NmnSPNr and https://ibb.co/C0nwG4D info.component.ts / The Info component is a child component of the Item component, displayed when a specific link is routed to. export class InfoComponent imp ...

What is the process for altering the background color of a modal?

I'm trying to figure out how to change the background color of my modal once it's displayed, similar to this example: https://i.stack.imgur.com/fOUDZ.png. I want the background color to cover the entire page and not just the modal itself. When I ...

Retrieve a single document using Angularfire2 without setting up a listener

I'm facing an issue with angularfire2 v6 and angular 11. Specifically, I am attempting to retrieve a single document from the users collection based on their email without utilizing valueChanges() or snapshotChanges(). Realtime updates are not necessa ...

When using the `Node fs.readstream()` function, the output includes `<Buffer 3c 3f 78 6d 6c ...>`, which is not in a readable

Handling a large XML file (~1.5gb) in Node Js by streaming it to process data in chunks has proven challenging due to the complexity of the documentation. A simple code snippet I am currently using is: var fs = require('fs'); var stream = fs.c ...

Challenge encountered with asynchronous angular queries

Dealing with asynchronous calls in Angular can be tricky. One common issue is getting an array as undefined due to the asynchronous nature of the calls. How can this be solved? private fetchData(id){ var array = []; this.httpClient.get('someUrl ...

Refreshing a React form

this.state = { name: "", arr: [], story: "" }; add(e) { e.preventDefault(); this.setState({ story: e.target.value }); this.state.arr.push(this.state.story); this.form.reset(); } <form action=""> <input onChange={this.b} type="t ...

How can I replicate the functionality of the span element using Javascript?

Using Javascript, I am able to display a paragraph without the need for HTML. By adding it to an HTML id, I can manipulate individual words within the text. My goal is to make specific words cursive while keeping the entire paragraph in its original font s ...

Combining the devexpress dxDataGrid with Angular's $scope for seamless web development

I'm encountering difficulties with binding $scope in angular and dxDataGrid. Utilizing the devexpress library dx.all.js, which enhances the dxDataGrid with various features, I have a div for dx-data-grid and attempting to transfer the selected row da ...

The transitionend event fails to trigger if there is no active transition taking place

Take a look at this: http://jsfiddle.net/jqs4yy0p/ JS $('div').addClass('switch').on('transitionend', function(e){ alert('end'); }); CSS div { background-color: red; /*transition: background-colo ...

Change prompt-sync from require to import syntax

In my Node project, I have integrated the prompt-sync module. const prompt = require('prompt-sync')(); const result = prompt(message); To maintain consistency in my TypeScript code, I decided to switch from using require to import. In order to ...

What is the significance of the -infinity value in the JavaScript console?

Recently, while learning JavaScript ES6, I came across a strange result of -infinity on my console when running the following code: let numeros = [1, 5, 10, 20, 100, 234]; let max = Math.max.apply(numeros); console.log(max); What does this ...