how to solve this jquery problem
- <script type="" src="http://code.jquery.com/jquery-1.5.js" ></script>
- <script type="text/javascript">
- var delay = 4000; // you can change it
- var count = 5; // How much items to animate
- var showing = 3; //How much items to show at a time
- var i = 0;
- function move(i) {
- return function() {
- $('#feed'+i).remove().css('display', 'none').prependTo('#feeds');
- }
- }
- function shift() {
- var toShow = (i + showing) % count;
- $('#feed'+toShow).slideDown(1000, move(i));
- $('#feed'+i).slideUp(1000, move(i));
- i = (i + 1) % count;
- setTimeout('shift()', delay);
- }
- $(document).ready(function() {
- setTimeout('shift()', delay);
- });
- </script>
- </head>
- <body>
- <div id="container">
- <!-- Header Logo -->
- <div class="slider"><div class="arrival_button">Wait for just 4 seconds...!</div>
- <div class="sliding"><div id="feeds">
- <div class="item" id="feed0" style="display: none;"><div class="thumbnail"><img alt="image" src="http://www.flashdaweb.com/blog/wp-content/uploads/2008/10/website_development_program.jpg" width="125" height="100"></div><div class="info">hello this is me</div></div>
- <div class="item2" id="feed1" style="display: none;"><div class="thumbnail1"><img alt="image" src="http://www.esellswebdesign.com/wp-content/uploads/2008/08/designing-a-fast-loading-website.jpg" width="125" height="100"></div><div class="info1">hello </div></div>
Now come towards the problems. I'm new to
jQuery thats why my question might be stupid.
1: When the page load why it takes so much time to start sliding.
2:After sliding is completed it starts in reverse order i.e its slide up in the end i comment$('#feed'+i).slideUp(1000, move(i));this line but then the slide will stop when it completed. so is there a way to continously start the slide in slidedown direction.