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

Gridview displaying varying border styles in CSS

I'm really struggling with this issue. I have a GridView and I want to ensure that the borders are consistent across all browsers. Right now, I'm experiencing different outcomes in IE, FF, and Chrome. Despite my best efforts with CSS (I'm re ...

The Ubiquity CmdUtils.setSelection function does not support replacing HTML code

I'm working on a Ubiquity command to replace selected links or URLs pointing to images with the actual image itself. However, I've found that the CmdUtils.setSelection() function doesn't work when there are html tags in the selection, render ...

Load specific data using jQuery's ajax method

Looking to dynamically change the text of a div based on content from another page that pulls data from a database. Specifically, I have a URL "Ajax/popup.aspx?pID=23" which returns a simple HTML file with an h2 and some text. I plan to use .load function ...

Update the formatting of the dates in the dateRangePicker

Utilizing a dateRangePicker, I am receiving dates in the format "mm-dd-yyyy". Below is my HTML code: <input type="text" name="TextDate" value="10/24/1984" /> Here is the script being used: <script> $(function() { $(&apos ...

Ways to separate a portion of the information from an AJAX Success response

I am currently working on a PHP code snippet that retrieves data from a database as follows: <?php include './database_connect.php'; $ppid=$_POST['selectPatientID']; $query="SELECT * FROM patient WHERE p_Id='$ppid'"; $r ...

Using JQuery's .on method with a .change event handler within a conditional statement

Embarking on a new quest... In my possession is this mighty function... $('.Discount').live({ focusout: function() { var $tr = $(this).closest('tr'); var CustDiscount = $('#CustDiscount:eq(0)').val ...

The button must be programmed to remove a specific item from the server

I am currently developing an application to monitor my expenses using javascript, nodejs, express, and handlebars as the templating engine. Within the app, I have a "list" div that displays all of my expenses. (There is an add button next to the list, not ...

Issue with Bootstrap modal not closing

I've encountered an issue with a bootstrap modal popup. When I try to close the popup, it doesn't behave as expected. Instead of just hiding the popup and removing the backdrop, it hides the popup but adds another backdrop, making the screen almo ...

Making an AJAX request in Javascript to retrieve multiple values using the HTTP method 'GET' from a URL

xmlhttp.open("POST","BAConsultRecordsAJAX.php?q="+str,true); Could this be achieved? xmlhttp.open("GET","BAConsultRecordsAJAX.php?q="+str+"j="+str2,true); I need to have values stored in both q and j fields. ...

IE8 encountering issues with Jquery ajax() request

My current issue involves submitting data using ajax from forms with a class of ajax. This functionality works flawlessly in Firefox, Safari, and Chrome, but is unsuccessful in Internet Explorer. ajax: function() { $('form.ajax').live(&apo ...

Cursor hovers over button, positioned perfectly in the center

I am facing a challenge with implementing a hover function for a set of buttons on the screen. The goal is to display the mouse pointer at the center of the button upon hovering, rather than the actual position of the cursor being displayed. I have tried u ...

Is there a way for me to access this user's data with just a click?

When selecting a user from the list, more information should be displayed on the right. However, currently, a random user is being shown. Should I retrieve its index and compare them? Assistance is needed to clarify this issue and locate the necessary info ...

What techniques do Node libraries employ to achieve asynchronous execution in a professional manner?

After researching how Node Bcrypt accomplishes asynchronous execution with the following code: bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) { // Store hash in your password DB. }); I am curious about how they manage to perform com ...

Achieve resumable uploads effortlessly with google-cloud-node

While this code works well for regular uploads, I am curious about how the resumable upload feature functions when a user loses connection during a large upload. Does simply setting 'resumable' to true in the writeStream options make it work effe ...

What is the process for attaching an iterator to the name value of every element within a cloneNode?

Consider the following scenario: <div id="addNewMenuElementPart2"> Numerous elements with a name attribute are present here. </div> <div id="addNewMenuElementPart3Optional"></div> Additionally, t ...

When the class changes, V-for re-renders every component

Currently, I am in the process of changing classes for images based on their index using the moveIndex method and key events. While this works smoothly on computers, it seems to take significantly longer when implemented on TVs. The process runs smoothly w ...

Is your data coming in as NaN?

I am currently developing a basic webpage that has the capability to calculate your stake and determine your return, reminiscent of a traditional betting shop. As of now, I have successfully hard coded the odds into my page. However, while testing my code ...

Tips for retrieving a value from a callback function?

How do I return a value from a callback function? The following code snippet is what I have: function storeData(data) { const id = "5f354b7470e79f7e5b6feb25"; const body = { name: "john doe" }; bucket.insert(id, body, (error, r ...

Introducing space between div elements changes the arrangement of columns

I am facing an issue with my layout consisting of 6 div tags divided into 2 rows of fixed height. Whenever I try to add a margin around the divs, the rightmost div gets pushed down to the next row. How can I solve this problem? HTML: <div class="contai ...

Storing radio button selection in a database using Ajax upon clicking

I have managed to successfully save the value of a radio button to the database on click using AJAX. However, I am facing an issue where if I go back to select the radio button again, nothing happens in the database. The value only gets updated when I se ...