Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HTML
<head>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#div1").hide(4000);
        });
        $(function () {
            $("#div1").slideDown(300);
        });
        $(document).ready(function () {
            $("#div2").hide(4000);
        });
        $(function () {
            $("#div2").slideDown(300);
        });
      
    </script>
</head>
<body>
    
    <div id="div1" style="background-color: red; width: 100px; height: 110px;"></div>
    <div id="div2" style="background-color: green; width: 110px; height: 120px;"></div>
</body>
</html>


i want to do slideDown frist for div1 and after complete this do SlideDown for div2!
i don't want take slideDown for both in one time!
how do that?

- MK Edit -
Codeblocks added.
Posted
Updated 9-Mar-14 12:18pm
v4

JavaScript
$(function () {
           $("#div1").slideDown(1000, function(){
           $("#div2").slideDown(1000)
        });


(Peter's solution will work)
 
Share this answer
 
You can put the slidedown method of div2 in a call back function of div1:
$(document).ready(function(){
            $("#div1, #div2").hide();
            $("#div1").slideDown(2000, function(){
                        $("#div2").slideDown(2000)
    });
})
 
Share this answer
 
v4

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