forked from Dogfalo/materialize
-
-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Before submitting...
- I have searched for duplicate or closed issues.
- I have read the CONTRIBUTING document and my issue is following the guidelines.
- I have read the template completely before filling it in.
Context
The onCycleTo()
method does not get called when I interact with a carousel.
Current Behavior
The onCycleTo()
method never gets called
Expected behavior
The onCycleTo()
method gets called when the carousel item is moved.
Possible Solutions or Causes
Perhaps this method is depricated?
Steps to reproduce
npm i @materializecss/materialize
- Copy this code into a file called
test.html
<link rel="stylesheet" href="node_modules/@materializecss/materialize/dist/css/materialize.min.css" />
<style>
.carousel-item div {
height: 100%;
border: 5px solid black;
background-color: red;
font-size: 48;
text-align: center;
}
</style>
<div class="carousel carousel-slider">
<div class="carousel-item active">
<div>1</div>
</div>
<div class="carousel-item active">
<div>2</div>
</div>
<div class="carousel-item active">
<div>3</div>
</div>
<div class="carousel-item active">
<div>4</div>
</div>
</div>
<script src="node_modules/@materializecss/materialize/dist/js/materialize.min.js"></script>
<script>
const myCarousel = M.Carousel.init(document.querySelector('.carousel'), {
fullWidth: true,
onCycleTo: function () {
console.log('Hello World');
},
});
</script>
Your Environment
- Version used: 2.2.2
- Browser Name and version: Firefox 143
- Operating System and version (desktop or mobile): Linux Mint 22
- Additional information you want to tell us: Installed Materialize using npm
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working