View Single Post
ישן 08-12-10, 19:25   # 1
morsrh
חבר מתקדם
 
morsrh's Avatar
 
מיני פרופיל
תאריך הצטרפות: Feb 2010
מיקום: אשקלון.
גיל: 31
הודעות: 444
שלח הודעה באמצעות MSN אל morsrh

morsrh לא מחובר  

Question jquery מה הבעיה פה?

למה הפונקציה הזאת קודם משנה צבע ורק אחרי זה היא מבצעת פקודות ולא קודם פקודות ואז שינוי צבע כמו שזה אמור לעשות?

הפונקציה היא :
HTML קוד:
function fd(){
            $("#thisdiv").fadeTo("slow" , 0.25);
            $("#thisdiv").animate({height:10},"slow");
            $("#thisdiv").hide("slow");
            $('#thisdiv').css("background-color", "yellow");
            $("#thisdiv").show("slow");
            $("#thisdiv").animate({height:300},"slow");
            $("#thisdiv").fadeTo("slow" , 1);
            
        }
והדף המלא הוא :
HTML קוד:
<html>

<head>
    <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
    <script type="text/javascript">
        function fd(){
            $("#thisdiv").fadeTo("slow" , 0.25);
            $("#thisdiv").animate({height:10},"slow");
            $("#thisdiv").hide("slow");
            $('#thisdiv').css("background-color", "yellow");
            $("#thisdiv").show("slow");
            $("#thisdiv").animate({height:300},"slow");
            $("#thisdiv").fadeTo("slow" , 1);
            
        }
    </script>
    <style type="text/css">
        .tdiv{
            height: 300px;
            width:300px;
            background-color:blue;
        }
    </style>
</head>
<body>

<div id="thisdiv" class="tdiv"></div>
<button onclick="fd()">to hide</button>

</body>
</html>
אז מהיא הבעיה?
תודה.
  Reply With Quote