最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make the jquery play automatically? - Stack Overflow

programmeradmin2浏览0评论

I have a question about my slideshow, i want it to play automatically, how to do it???

i've already changed the autoplay setting from false to true, but still cant.

here is my code:

 <script>
  jQuery(document).ready(function($) {
  $('#full-width-slider').royalSlider({
    arrowsNav: true,
    loop: true,
    keyboardNavEnabled: true,
    controlsInside: false,
    imageScaleMode: 'fill',
    arrowsNavAutoHide: false,
    autoScaleSlider: true, 
    autoScaleSliderWidth: 960,     
    autoScaleSliderHeight: 350,
    controlNavigation: 'bullets',
    thumbsFitInViewport: false,
    navigateByClick: true,
    startSlideId: 0,
    autoPlay: true,
    transitionType:'move',
    globalCaption: true
  });
});

</script>

and here is my link if you need to read the jquery file

My Slider problem link

THANKS

I have a question about my slideshow, i want it to play automatically, how to do it???

i've already changed the autoplay setting from false to true, but still cant.

here is my code:

 <script>
  jQuery(document).ready(function($) {
  $('#full-width-slider').royalSlider({
    arrowsNav: true,
    loop: true,
    keyboardNavEnabled: true,
    controlsInside: false,
    imageScaleMode: 'fill',
    arrowsNavAutoHide: false,
    autoScaleSlider: true, 
    autoScaleSliderWidth: 960,     
    autoScaleSliderHeight: 350,
    controlNavigation: 'bullets',
    thumbsFitInViewport: false,
    navigateByClick: true,
    startSlideId: 0,
    autoPlay: true,
    transitionType:'move',
    globalCaption: true
  });
});

</script>

and here is my link if you need to read the jquery file

My Slider problem link

THANKS

Share Improve this question edited Sep 10, 2012 at 7:57 David Hedlund 130k33 gold badges204 silver badges223 bronze badges asked Sep 10, 2012 at 7:55 Christopher Leandro KwokChristopher Leandro Kwok 851 gold badge2 silver badges9 bronze badges 1
  • try give like here – Chandra Sekhar K Commented Sep 10, 2012 at 8:09
Add a ment  | 

2 Answers 2

Reset to default 3

Try this,

autoPlay: {
   enabled: true,
   delay: 1500
}

Change the delay according to your requirement.

Or just try,

autoPlay : {
     enabled : true
}

AutoPlay property requires an object not true\flase value, look at doc

Try this code:

 <script>
  jQuery(document).ready(function($) {
  $('#full-width-slider').royalSlider({
    arrowsNav: true,
    loop: true,
    keyboardNavEnabled: true,
    controlsInside: false,
    imageScaleMode: 'fill',
    arrowsNavAutoHide: false,
    autoScaleSlider: true, 
    autoScaleSliderWidth: 960,     
    autoScaleSliderHeight: 350,
    controlNavigation: 'bullets',
    thumbsFitInViewport: false,
    navigateByClick: true,
    startSlideId: 0,
    autoPlay:  {
            // autoplay options go gere
                enabled: true,
            pauseOnHover: true
               }
  });
});

Edit: "}" was missing after " pauseOnHover: true" .

发布评论

评论列表(0)

  1. 暂无评论