Click here to Skip to main content
14,739,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone
I want to use settimeout() function with .each function.Basically iwant to show each image for 5 seconds and then next but i am only able to see last image.The .each executes and do not stop for 3 seconds.How can i do this?This is how i am doing.
<html xmlns="">
<head runat="server">
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $('#Images').find('li').each(function () {
                var img = this;
                setTimeout(function () {
                }, 3000);


        function Start(img) {
    <form id="form1" runat="server">
    <div id="slideshow">
    <div style="display:none;">
    <ul id="Images">
    <li><img src="images/ajax-loader.gif" /></li>
    <li><img src="images/Ajax Loader White.gif" /></li>
    <li><img src="images/fancybox_sprite.png" /></li>

Please help.

1 solution

You are using jQuery so why not use $.delay()[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900