Initial slider writing phase
-
I'm trying to write a slider. That's what I have for now. http://vinnie95.22web.net/slide/1.html ♪ Comment, please.
<script src="http://code.jquery.com/jquery-1.7.min.js"></script> <script> $(function () { var slide = 500; var pos = 1; $('#left').click(function () { slide2 = slide * pos; $('ul').animate({ marginLeft: '-' + slide2 + 'px' }, 700); if (pos < ($('img').length) - 1) pos += 1; else pos = 1; }) }) </script>
and
<style> #main { border: 1px solid 0px; height: 320px; margin: 0px auto; overflow: hidden; width: 500px; }
ul {
list-style: none;
padding: 0px;
width: 10000px;
}li {
float: left;
}</style>
and
<div id="main">
<ul>
<li><img src="01.jpg"/></li>
<li><img src="02.jpg"/></li>
<li><img src="03.jpg"/></li>
<li><img src="04.jpg"/></li>
<li><img src="05.jpg"/></li>
</ul>
<div style="margin-top:290px">
<button id="left"></button>
</div>
</div>
-
The shooters should be strictly on the other side. Analogy to the scrub. It's just because everyone's used to it, indicating the direction of the shift in relation to the ribbon, not the direction of the tape to the monitor.
The rest is pretty.By the way, how's the problem with pictures of other proportions resolved?