After loading Orbit, the user should be able to navigate through the Slides back and forth.
But that actually happens is that the slider stucks after clicking on the right arrow, the second slide loads but the whole control gets stuck after that and cannot go back or forward.
{
"name": "tstzurb",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"foundation-sites": "^6.6.1",
"jquery": "^3.4.1",
"what-input": "^5.2.6"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation Starter Template</title>
<link rel="stylesheet" href="node_modules/foundation-sites/dist/css/foundation.css" />
</head>
<body>
<h1>Hello, world!</h1>
<div class="orbit" role="region" aria-label="Favorite Space Pictures" data-orbit>
<div class="orbit-wrapper">
<div class="orbit-controls">
<button class="orbit-previous"><span class="show-for-sr">Previous Slide</span>◀︎</button>
<button class="orbit-next"><span class="show-for-sr">Next Slide</span>▶︎</button>
</div>
<ul class="orbit-container">
<li class="is-active orbit-slide">
<figure class="orbit-figure">
<img class="orbit-image" src="https://placehold.it/1200x600/999?text=Slide-1" alt="Space">
<figcaption class="orbit-caption">Space, the final frontier.</figcaption>
</figure>
</li>
<li class="orbit-slide">
<figure class="orbit-figure">
<img class="orbit-image" src="https://placehold.it/1200x600/888?text=Slide-2" alt="Space">
<figcaption class="orbit-caption">Lets Rocket!</figcaption>
</figure>
</li>
<li class="orbit-slide">
<figure class="orbit-figure">
<img class="orbit-image" src="https://placehold.it/1200x600/777?text=Slide-3" alt="Space">
<figcaption class="orbit-caption">Encapsulating</figcaption>
</figure>
</li>
<li class="orbit-slide">
<figure class="orbit-figure">
<img class="orbit-image" src="https://placehold.it/1200x600/666&text=Slide-4" alt="Space">
<figcaption class="orbit-caption">Outta This World</figcaption>
</figure>
</li>
</ul>
</div>
<nav class="orbit-bullets">
<button class="is-active" data-slide="0">
<span class="show-for-sr">First slide details.</span>
<span class="show-for-sr" data-slide-active-label>Current Slide</span>
</button>
<button data-slide="1"><span class="show-for-sr">Second slide details.</span></button>
<button data-slide="2"><span class="show-for-sr">Third slide details.</span></button>
<button data-slide="3"><span class="show-for-sr">Fourth slide details.</span></button>
</nav>
</div>
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/what-input/dist/what-input.min.js"></script>
<script src="node_modules/foundation-sites/dist/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>
See https://github.com/foundation/foundation-sites/pull/11944
This is a duplicate of the issues reported in our community. Closing because of this.
@DanielRuf , Thanks for your reply. I have merged that PR and rebuilt the SCSS but still facing the same issue. How can I merge the batch today?
and rebuilt the SCSS
It's JavaScript, see https://github.com/foundation/foundation-sites/pull/11944/files
Hi Daniel,
Yes, I made the change in that JS file already. But the issue is still there (Orbit stucks after slide #2). In order to benefit from that change, should I explicitly import that JS file somewhere? I have even changed my package file to use 6.5.3 (ex. "foundation-sites": "6.5.3"), but I still have the issue in all browsers!
Am I using Orbit incorrectly ?! I just used the basic example from the docs!
Did you also import motion-ui? Because this is required here.
Can you provide a codepen where we can reproduce / see your issue?
Thanks @DanielRuf. I missed the part that says that motion-ui is required for Orbit to work properly. I ended up disabling motion via data-use-m-u-i="false", and it works now. Maybe it should be disabled by default as the functionality requires addition library? This will make orbit work out of the box, and only those who seeks the extra feature can following the steps to enable it.
Thanks again.
Currently this requirement is documented.
https://get.foundation/sites/docs/orbit.html#basics
Please note that apart from Javascript, Motion UI is a dependency for Orbit to work properly. If in case, you don't want any animations within your Carousel, you can always disable the animation.
Disabling it by default would be a breaking change.
Most helpful comment
Thanks @DanielRuf. I missed the part that says that motion-ui is required for Orbit to work properly. I ended up disabling motion via data-use-m-u-i="false", and it works now. Maybe it should be disabled by default as the functionality requires addition library? This will make orbit work out of the box, and only those who seeks the extra feature can following the steps to enable it.
Thanks again.