The environment that i'm working with is heavily dynamic, and i believe that is messing with some slider functionality as things inside it are being ajax loaded and moved quite often.
I am developing a web app for ipad, and it has two sliders on it so far. One for a top set of tiles, and another for a lower set. Three tiles are shown on screen at a time simply by setting their width to 33.333etc%
When i load the page without initializing slider, the tiles form perfectly as i had them set with css. But if i load the page and initialize slider, the slider loads with width 0. Even if i set it to a pixel width instead of percent (using the standard shown on your site).
Here is a snippet of the code, cant show it all for trade secret reasons but i'll do what i can.
<div id="sliderHolder">
<div class="sliderHolder" id="TopSliderHolder">
<div id="tileSlider_Top" class='tileSlider_Top'>
<div class='slider'>
<div class='sliderTile' id='item1'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item2'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item3'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item4'>
<div class='tilePadding'></div>
</div>
</div>
</div>
</div>
<div class="sliderHolder" id="BottomSliderHolder">
<div id="tileSlider_Bottom" class='tileSlider_Bottom'>
<div class='slider'>
<div class='sliderTile' id='item1'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item2'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item3'>
<div class='tilePadding'></div>
</div>
<div class='sliderTile' id='item4'>
<div class='tilePadding'>
</div>
</div>
<div class='sliderTile' id='item5'>
<div class='tilePadding'></div>
</div>
</div>
</div>
</div>
</div>
the sliderholder div has its height and width set to pixel dimensions by js on window resize, and the sliders are destroyed/restarted on window resize.
The initialization code is thus:
$('#tileSlider_Top').iosSlider({
snapToChildren: true,
desktopClickDrag: true,
navSlideSelector: '#tileSlider_Top .slideSelectors .item',
onSlideComplete: topSlideComplete,
onSliderLoaded: topSliderLoaded,
onSlideChange: topSlideChange,
frictionCoefficient: '0.96',
snapFrictionCoefficient: '0.96',
elasticPullResistance: '.6'
});
$('#tileSlider_Bottom').iosSlider({
snapToChildren: true,
desktopClickDrag: true,
frictionCoefficient: '0.96',
snapFrictionCoefficient: '0.96',
elasticPullResistance: '.6'
});
great, having trouble showing html code github? one sec man while i fix this...