I'm really not familiar with the swipe.js program you're using, and it's quite a bit to try to read through manually (which is probably why no one else has replied). But putting the // before every line seems counterproductive; why set the variable values if the line is ignored?
You might try removing the //, just to find out. I'm guessing that it should either be this:
<script>
var elem = document.getElementById('mySwipe');
window.mySwipe = Swipe(elem, {
startSlide: 4,
auto: 3000,
continuous: true,
disableScroll: true,
stopPropagation: true,
callback: function(index, element) {},
transitionEnd: function(index, element) {}
});
</script>
OR this, if you're using jQuery:
<script>
window.mySwipe = $('#mySwipe').Swipe().data('Swipe');
</script>
If that's not it, the other thing that stood out to me is that I couldn't find "dots" or "position" in the swipe.js file, so I'm not sure how these are defined. Are these the ID names that the instruction file gave?
I would have thought that there would be something to make each picture correspond to a dot image; like:
<div id="pic_1"><img src="image_1.jpg"></div>
<div id="dot_1"><img src="dog_1.jpg"></div>
Then, the script could refer to
for (var i=0; i < n; i++) {
document.getElementById('pic_' + i).innerHTML = "something";
document.getElementById('dot_' + i).innerHTML = "something";
}
If you're doing this for the sake of learning, this code might be easier to read and learn:
[
javascriptkit.com...]
If this is more than a project, though, and necessary for work, it might be easier to just make it a regular onClick event rather than trying to code a swipe.