scottalguire / grouploop Goto Github PK
View Code? Open in Web Editor NEWA jQuery plugin that creates a marquee with a group of DOM elements.
A jQuery plugin that creates a marquee with a group of DOM elements.
This is a problem I found during multiple tests.
Analyzing the source, it is operating based on the entire window size.
In my opinion, it should move based on 'childWrapper'.
So, I modified it as below and tested it.
window.addEventListener("resize", function ()
{
windowWidth = $(el).find(settings.childWrapper)[0].scrollWidth / 2 - 1;
wrapperWidth = $(el).width();
if (settings.stickFirstItem)
{
stickFirstItemFunc();
}
});
Now it works as desired.
Hi and thank you so much for this plugin. However I can't seem to understand why at the last word the animation is jumpy and the text appears to be jumping. Would you mind taking a look? There are 6 words.
https://theintegrateur.com/clients/inter/
Thanks!
Hi!
I noticed an issue with the looping part of the animation process. At the moment the translation is done depending on the window width. When the group is larger than that, the looping animation jumps earlier to the first position, making the effect look choppy.
The best I can see (and I am not a JS expert), you are using the main container width for wrapperWidth
at
grouploop/src/grouploop-1.0.3.js
Line 30 in 989cff9
childWrapper
element. Thus your examples always transition for a distance equal to the window width.
One more thing to consider: the loop element might be inside a container narrower than the window width. Perhaps you might want to look at using the parent container width and the childWrapper width when calculating the translation values?
Here is an example where I am using the latest version (1.0.3) and the jumping effect is very visible:
Looking forward to hearing back from you.
Regards,
Adrian
Hi! I am using your script to animate a series of Bootstrap cards and I noticed that the forward: false
option causes an error at line 112:
grouploop/src/grouploop-1.0.1.js
Line 112 in 3a3fecb
The script is looking for the transform
property which doesn't exist by default.
My workaround has been to add a dummy translation to the child wrapper element:
<div class="slider-rail" style="transform: translateX(0)">...</div>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.