Comments (10)
You need to do
import { Marquee, loop } from "dynamic-marquee";
and then drop the dynamicMarquee.
โs
from dynamic-marquee.
thank u. But what u mean by " drop dynamicMarquee
's ?
from dynamic-marquee.
i have one more doubt. How to give conditions that update the itemList after 'x' items?
Example:
cost array1 = ['a','b','c','d','e'];
const array2 = ['z'];
in this example, first loop array1
. After completing array1
then start array2
how can achieve this?
from dynamic-marquee.
The thing you get back from loop
has an update
function on it that you can call at any point with an array of new functions with the new items
from dynamic-marquee.
But how do i know that array1
is completed ?
from dynamic-marquee.
const control = loop(marquee, array1);
After loop is ended
control.update([() => array2);
What i need is code for After loop is ended
How do i know that is loop has ended?
from dynamic-marquee.
Canโt you have a single array that contains everything?
from dynamic-marquee.
cost array1 = ['a','b','c','d','e'];
const array2 = ['z'];
Result i wanted was (infinite 'z')
'a','b','c','d','e','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z'
from dynamic-marquee.
I don't think loop
is the correct thing for this case then. You probably want something like
const items = ['a', 'b', 'c', 'd', 'e'];
marquee.onItemRequired(() => {
const next = items[0];
if (items.length > 1) items.shift();
return next;
});
marquee.appendItem(items[0]);
and then you can do items.push('f')
and this should always keep looping the last item.
from dynamic-marquee.
Something like https://stackblitz.com/edit/typescript-uzfjwd?file=index.ts
from dynamic-marquee.
Related Issues (20)
- Word Wrap? HOT 6
- No room for item. HOT 2
- StartVisible Marquee HOT 7
- clear() is broken HOT 2
- How to start crawl from perticular position? HOT 6
- More than one Spacing issue between the text HOT 6
- Character Overlapping HOT 2
- How to add fetch support from json? HOT 1
- Is there any callback events available? HOT 6
- Marquee wont work in Angular after giving build HOT 8
- Support stop on mouseover? HOT 2
- Javascript error on safari with loop function HOT 3
- Infinite loop when using images in upDown mode HOT 11
- [Question] HTML Content HOT 4
- [Question] Stop on touch? (loop?) HOT 1
- Why this is not working. HOT 6
- Left to Right HOT 3
- Action required: Greenkeeper could not be activated ๐จ
- Marquee is a little jerky HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamic-marquee.