русский  עברית
tadam logo
דוגמאות jQuery
מצאתם שגיאה?
סמנו אותה עם העכבר ותלחצו
Ctrl + Enter
בדיקת כתיב Xhtml.co.il
Orphus system

סלקטור animated

תיאור: חיפוש כל האלמנטים שעליהם כרגע מופעלת אנימציה.

jQuery(':animated')

הוספה בגרסה: 1.2

דוגמאות

מחליף צבע של כל div שמופעלת עליו אנימציה.
    $("#run").click(function(){
      $("div:animated").toggleClass("colored");
    });
    function animateIt() {
      $("#mover").slideToggle("slow", animateIt);
    }
    animateIt();
תוצאת הפעלה קוד לעיל:
קוד מלא:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>  
  <script>
  $(document).ready(function(){
    $("#run").click(function(){
      $("div:animated").toggleClass("colored");
    });
    function animateIt() {
      $("#mover").slideToggle("slow", animateIt);
    }
    animateIt();
  });
  </script>
  <style>
  div { background:yellow; border:1px solid #AAA; width:80px; 
        height:80px; margin:5px; float:left; }
  div.colored { background:green; }
  </style>
</head>
<body>
  <button id="run">Run</button>
  <div></div>
  <div id="mover"></div>
  <div></div>
</body>
</html>
האם מידע זה היה מועיל?
   

תגובות