I've used one image slider. In HTML code of this jQuery image slider there is one hidden field which contains the numerical value. This numerical value is nothing but the time in seconds for which each slider image should display. Once the time finishes the next image will display.
The HTML and jQuery code for it is as follows :
HTML code :
<input type="hidden" name="brand_slider_time" id="brand_slider_time" value="10">
<div class="leaderboard">
<ul id="demo1">
<li><a href="#slide1"><img src="img/Slid1.png" alt="Lorem Ipsum"></a></li>
<li><a href="#slide2"><img src="img/Slid2.png" alt="Lorem Ipsum"></a></li>
<li><a href="#slide3"><img src="img/slid3.png" alt="Lorem Ipsum"></a></li>
</ul>
</div>
jQuery code :
$(function() {
var demo1 = $("#demo1").slippry({
transition: 'fade',
useCSS: true,
speed: 1000,
pause: 3000,
auto: true,
preload: 'visible'
});
$('.stop').click(function () {
demo1.stopAuto();
});
$('.start').click(function () {
demo1.startAuto();
});
$('.prev').click(function () {
demo1.goToPrevSlide();
return false;
});
$('.next').click(function () {
demo1.goToNextSlide();
return false;
});
$('.reset').click(function () {
demo1.destroySlider();
return false;
});
$('.reload').click(function () {
demo1.reloadSlider();
return false;
});
$('.init').click(function () {
demo1 = $("#demo1").slippry();
return false;
});
});
The necessary jQuery and CSS files have been already included.
For passing the value of hidden field as a n argument to the slider function I tried the code below in same file but it didn't work out for me.
$(document).ready(function() {
var val = $('#brand_slider_time').val() * 1000;
demo1.destroySlider();
demo1 = $("#demo1").slippry({
pause: val
});
});
I wrote this code above the slider function code in a same file.
How should I pass this value of 10 seconds to the jQuery slider function and use this value into a function such that each image from slider will appear for 10 seconds?
Thanks for spending some of your valuable time in understanding my issue. If you need any more information regarding this issue please let me know.
Any kind of hep would be highly appreciated. Waiting for your precious replies.