javascript - touchslider.com how to add a few options -
using code http://touchslider.com
1.) how can "currentclass" (the image starts with) set random? 1 of images appear on load?
2.) how can toggle script clicking on image?
to more specific, there navigation links , images can click/swipe how can set when click on image, locks image, disabling navigation links , swipe??
edit: 2nd option solved +
i able work around editing touchslider.com script, , made 2nd option requested possible using transparent div.
js (in body)
<script> $(document).ready(function(){ var $content = $("#disablediv1").hide(); $(".lock").on("click", function(e){ $content.toggle(); }); }); </script>
html (wrap image)
<a class="lock" href="#"><img src="imagelink"></img></a>
html (transparent div positioned on links disabled)
<div id="disablediv1"></div>
css (for transparent div)
#disablediv1{ position:absolute; left:200px; top:20px; width:600px; height:544px; z-index:999; }
^hopefully find helpful.
*i'm still looking way have slider show it's first image @ random...
i tidied original html , css in touchslider example. http://touchslider.com/
working example.
this works image preloader, efficiency. image src excluded html , there array present images, named gallery.
there 2 loops. first loop sets random order in array structure. example:
2,0,1 1,2,0 0,1,2
the second loop assigns image location, based on image path gallery array.
random generator.
you can search around better random number generators, , replace code here.
// randomize array galleryposition.sort(function() {return 0.5 - math.random()});
Comments
Post a Comment