javascript - Can't get a simple jquery slider to work -
i trying jquery slider work on site. have not programmed because cannot, i'm trying use there , works on demo site. have tried several ready use jquery slideshow , sliders, without success. have found simplest 1 available, think cannot make 1 work either although think have followed steps instructed.. 1 have "http://responsiveslides.com/", files on github though: https://github.com/viljamis/responsiveslides.js
i have put in html <head>
<!-- slideshow begin --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/responsiveslides.min.js"></script> <script> $(function() { $("#slider1").responsiveslides({ auto: true, speed: 500, timeout: 4000 }); }); </script>
and in html
<div class="welcome section"><!-- welcome section begin --> <img src="mobile/media/logo2s.jpg" alt="" style="display:block; margin-left:auto; margin-right:auto;"> <div id="wrapper"> <ul class="rslides" id="slider1"> <li><img src="mobile/media/p_0001.jpg" alt=""></li> <li><img src="mobile/media/p_0002.jpg" alt=""></li> <li><img src="mobile/media/p_0003.jpg" alt=""></li> </ul> </div> </div><!-- welcome section end -->
the responsiveslides.min.js
on server under directory js
, in same directory html. have added relevant css .css
file, slider not slide.
no transitions @ all. don't think have missed have. can help?
follow on page.
you have this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="responsiveslides.min.js"></script>
you need (remember change .jpg file names 1, 2, etc.):
<ul class="rslides"> <li><img src="1.jpg" alt=""></li> <li><img src="2.jpg" alt=""></li> <li><img src="3.jpg" alt=""></li> </ul>
and css:
.rslides { position: relative; list-style: none; overflow: hidden; width: 100%; padding: 0; margin: 0; } .rslides li { -webkit-backface-visibility: hidden; position: absolute; display: none; width: 100%; left: 0; top: 0; } .rslides li:first-child { position: relative; display: block; float: left; } .rslides img { display: block; height: auto; float: left; width: 100%; border: 0; }
just don't put id; keep was:
<script> $(function() { $(".rslider").responsiveslides({ auto: true, speed: 500, timeout: 4000 }); });
hope works!
Comments
Post a Comment