question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to make the carousel map play automatically?

See original GitHub issue

I created a carousel component through the scenery package of scenejs. It works fine when I click on the next or previous one, but I don’t know how to make it play automatically, because I didn’t set jsx during initialization. The keyframes property is used instead of code: ` React.useEffect(() => { const scene = (SceneRef as any).current;

	const sceneItem = scene.getItem(".carousel");
	scene.getItem(".carousel").set({
		".carousel": {
			"0": {
				transform: {
					translateX: prevPos + "px"
				}
			},
			"1": {
				transform: {
					translateX: `${current * -parseFloat(width)}` + "px"
				}
			}
		}
	});
	scene.play();
}, [current, prevPos]);`

so what do I need to do? Thank you

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jiameng123commented, Jul 17, 2019

@daybrush

Thank you very much, this feature has helped me a lot.

0reactions
daybrushcommented, Jul 16, 2019

@jiameng123 Hi. react-scenejs@1.1.0 has been published.

ready props have been added. When you are ready to initialize, set ready to true.

render() {
    const { ready, keyframes} = this.state;
    return (<Scene keyframes={keyframes} ready={ready} autoplay >...</Scene>)
}
anywhere() {
    this.setState({
        ready: true,
        keyframes: { ... },
    });
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap Carousel autoplay - free examples & tutorial
Responsive Carousel autoplay built with Bootstrap 5. Examples of how to turn on and turn off the carousel autoplay.
Read more >
auto play of carousel slider - dart - Stack Overflow
CarouselSlider is already automatic here is my code that works so fine for me, you add a child of ( items ) static...
Read more >
Using Story Map Autoplay Mode - Esri
When autoplay is enabled, the autoplay control appears on the Story Map. Click to pause or play, or grab the slider to adjust...
Read more >
How to Build an Auto-Playing Slideshow with React - Tinloof
Our Slideshow component is divided in three containers: ... What is visible to the user is what is shown within the red box...
Read more >
Carousel: Autoplay - VCU Compass Web Framework
Take note. Online Services Outage. From 5 p.m. Dec. 2 to 10 a.m. Dec. 9, several important online systems will be unavailable. You...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found