Bug: iSlider displayed nothing except the first one when create some sliders use same option
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 441
- PR merge metrics
- No merged PRs in 30d
Description
first of all , forgive my poor English!
when create some sliders use same option and you can see this bug,
var imgList1 = [
{
content: './content-image/farm-1.jpg'
},
{
content: './content-image/farm-2.jpg'
},
{
content: './content-image/farm-3.jpg'
},
];
var imgList2 = [
{
content: './content-image/farm-1.jpg'
},
{
content: './content-image/farm-2.jpg'
},
{
content: './content-image/farm-3.jpg'
},
];
var imgList3 = [
{
content: './content-image/farm-1.jpg'
},
{
content: './content-image/farm-2.jpg'
},
{
content: './content-image/farm-3.jpg'
},
];
var imgList4 = [
{
content: './content-image/farm-1.jpg'
},
{
content: './content-image/farm-2.jpg'
},
{
content: './content-image/farm-3.jpg'
},
];
var imgList5 = [
{
content: './content-image/farm-1.jpg'
},
{
content: './content-image/farm-2.jpg'
},
{
content: './content-image/farm-3.jpg'
},
];
var sliderOption = {
isAutoplay: 1,
isLooping: 1,
isOverspread: 1,
animateTime: 800
}
$(document).ready(function(){
var slider1 = new iSlider(document.getElementById('iSlider_wrapper_1'), imgList1,sliderOption);
var slider2 = new iSlider(document.getElementById('iSlider_wrapper_2'), imgList2,sliderOption);
var slider3 = new iSlider(document.getElementById('iSlider_wrapper_3'), imgList2,sliderOption);
var slider4 = new iSlider(document.getElementById('iSlider_wrapper_4'), imgList2,sliderOption);
var slider5 = new iSlider(document.getElementById('iSlider_wrapper_5'), imgList2,sliderOption);
});
if you'er someone happend to try to resolve this problem , you can create slider option for every slider and just make the animateTime item as different values, like 800,801 or some other values and this problem will be resolved.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue by creating several iSlider instances with the shared sliderOption object shown in the report. Start at the iSlider constructor and trace how the options are stored or used across instances. Done means all created sliders display and operate independently while sharing the same options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100