English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Kurz über die Effektfunktionen von jQuery

jQuery bietet viele Effekte, wie z.B. Ein- und Ausblenden:<html>

 <head>
    <style>
      #box{width:200px;height:200px;hintergrund:rot;Deckkraft:1;}
    </style>
  </head>
  <body>
    <div id="box">
    </div>
    <input type="button" value="Verbergen/Anzeigen"id="bt1"<br/><br>/>
    <input type="button" value="Einblenden"id="bt2"<br/><br>/>
    <input type="button" value="Ausblenden"id="bt3"<br/><br>/>
    <input type="button" value="Einblenden"id="bt4"<br/><br>/>
    <input type="button" value="Ausblenden"id="bt5"<br/><br>/>
    <input type="button" value="Durchsichtig"id="bt6"<br/><br>/>
    <input type="button" value="Einblenden"/Ausblenden"id="bt7"<br/><br>/>
    <input type="button" value="Einblenden"/Ausblenden"id="bt7"<br/><br>/>
  </body>
  <script src="jquery-1.6.js"></script>
  <script>
    $("function"(){
        $("#bt1").click(function(){
              $("#box").toggle()1000)
              }),
        $("#bt2").click(function(){
              $("#box").slideDown()1500)
              }),
        $("#bt3").click(function(){
              $("#box").slideUp()1500)
              }),
        $("#bt4").click(function(){
              $("#box").fadeIn()1000)
              }),
        $("#bt5").click(function(){
              $("#box").fadeOut()1000)
              }),
        $("#bt6").click(function(){
              $("#box").fadeTo()1500,0.4)
              }),
        $("#bt7").click(function(){
              $("#box").fadeToggle()1000)
              }),
        $("#bt8").click(function(){
              $("box").slideToggle()1500)
              }
        }
  </script>
</html>

jQuery kann auch eine Funktion für einen rollenden Text implementieren, z.B. in folgendem Beispiel:<html>

<head>
    <style>
      #box{width:300px;height:50px;border:2px dashed lila;overflow:hidden;line-height:50px;margin:0 auto;color:red;font-size:30px;}
    </style>
  </head>
  <body>
    <div id="box"></div>
  </body>
  <script src="jquery-1.7.1.min.js"></script>
  <script>
    $("function"(){
        str="Ich bin ein Chinesen"
        $("#box").html(str)
        setInterval(go,300)
          function go(){
            str=str.substr(1)+str.substr(0,1)
            $("#box").html(str)
            }  
      }
  </script>
</html>

jQuery kann auch zur Implementierung einer Löschfunktion verwendet werden, z.B.:<html>

<head>
    <style>
      #box{
        width:400px;
        height:200px;
        border:1px solid black;
        }
    </style>
  </head>
  <body>
    <div id="box">
        <p id="a">Erste a</p>
        <p>Zweite</p>
        <p id="a">Dritte a</p>
        <p>Vierte</p>
    </div>
    <button id="del">Löschen</button>
    <button id="cle">Leeren</button>
  </body>
  <script src="jquery-1.6.js"></script>
  <script>
    $("function"(){
        $("#del").click(()
            function(){}
              $("p").remove("#a")
              });
        $("#cle").click(()
            function(){}
              $("#box").empty()
              });
      }
  </script>
</html>

jQuery wird eine Implementierung der Funktion zur Auswahl von Kursen bieten, z.B.:<html>

<head>
<title></title>
<style>
li{
  list-style:none;
}
#you{
  position:absolute;
  left:300px;
  top:10px;
}
ul{
  position:absolute;
  left:150px;
  top:10px;
}
</style>
<script src="jquery-1.6.js"></script>
<script>
  $("function"(){
    $("button:first").click(function(){
      $("#zuo>option:selected").prependTo($("#you"));
      //$("#you").append($("#zuo>option:selected");
    }
    $("button:eq(")1})
      $("#you>option:selected").appendTo($("#zuo"));
      //$("#you").append($("#zuo>option:selected");
    }
    $("button:eq(")2})
      $("#zuo>option").appendTo($("#you"));
    }
    $("button:eq(")3})
      $("#you>option").appendTo($("#zuo"));
    }
    $("button:eq(")4})
       //$("#zuo>option:first").before($("#zuo>option:selected"))
      $("#zuo>option:selected").prependTo($("#zuo"));
    }
    $("button:eq(")5})
      // $("#zuo>option:last").after($("#zuo>option:selected"))
      $("#zuo>option:selected").appendTo($("#zuo"));
    }
    $("button:eq(")6})
     $("#zuo>option:selected").prev().before($("#zuo>option:selected")) ;  
    }
    $("button:eq(")7})
     $("#zuo>option:selected").next().after($("#zuo>option:selected")) ;  
    }
  }
</script>
</head>
<body>
<select size="10" id="zuo" style="width:100px">
  <option>berufliches Englisch</option>
  <option>Hohe Mathematik</option>
  <option>Universität Chinesische Literatur</option>
  <option>Universität Physik</option>
  <option>Computer-Grundlagen</option>
  <option>Grundlegende Web-Design</option>
  <option>C-Sprachene Programmierung</option>
  <option>Datenstruktur</option>
  <option>UI-Design</option>
  <option>Produkt-Skript-Design</option>
  <option>Produkt-Skript-Verbesserung</option>
  <option>Produkt-Skript-Praxis</option>
</select>
<ul>
<li><button>Auswahl treffen</button></li>
<li><button>Auswahl zurücknehmen</button></li>
<li><button>Alles auswählen</button></li>
<li><button>Alles zurücknehmen</button></li>
<li><button>Nach oben legen</button></li>
<li><button>Nach unten legen</button></li>
<li><button>Nach oben verschieben</button></li>
<li><button>Nach unten verschieben</button></li>
</ul>
<select size="10" id="you" style="width:100px">
</select>
</body>
</html>

jQuery kann die Funktion des nach unten klappenden Fensters realisieren:<!DOCTYPE html>

<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript"> 
$(document).ready(function(){
 $(".flip").click(function(){
  $(".panel").slideDown("slow");
 });
});
</script>
<style type="text"}/css"> 
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>W3School - führenden Web-Technologie-Tutorial-Website</p>
<p>Im W3School,Sie finden hier alle erforderlichen Tutorials für die Website-Entwicklung.</p>
</div>
<p class="flip">Klicken Sie hier</p>
</body>
</html>
jQuery kann einfache Animationseffekte realisieren:<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js">
</script>
<script> 
$(document).ready(function(){
 $("button").click(function(){
  $("div").animate({left:'250px'});
 });
});
</script> 
</head>
<body>
<button>Starten Sie die Animation</button>
<p>Standardmäßig sind die Positionen aller HTML-Elemente statisch und können nicht verschoben werden. Wenn Sie die Position ändern möchten, erinnern Sie sich daran, das CSS-Positionseigenschaft des Elements auf relative, fixed oder absolute zu setzen.</p>
<div style="background:#98bf21;height:100px;width:100px;position:absolute;">
</div>
</body>
</html>
jQuery kann die Funktion des Beginns und Stopps einer Animation realisieren:<html>
  <head>
    <style>
      #box{width:100px;height:100px;background:violet;position:absolute;border-radius:50%;top:50px;}
    </style>
  </head>
  <body>
    <div id="box"></div>
    <button id="bt">Starten</button>
    <button id="bt1">Anhalten</button>
  </body>
  <script src="jquery-1.6.js"></script>
  <script>
    $("function"(){
        $("#bt").click(function(){
              $("div").animate({left:"800px",top:"300px",width:"500px",height:"500px"},3000)
              }),
        $("#bt1").click(function(){
              $("div").stop();
              }      
        }
  </script>
</html>

jQuery kann auch Funktionen für Bildwerbung mit aufwärts drehenden Bildern ausführen:<html>

<head>
    <style>
      #box{width:600px;height:300px;overflow:hidden;border:1px solid #000;margin:0 auto;}
      ul{list-style:none;}
      img{width:600px;height:300px;}
      *{padding:0;margin:0;}
    </style>
  </head>
  <body>
    <div id="box">
      <ul id="pic">
        <li><img src="1.png"></li>
        <li><img src="2.png"></li>
        <li><img src="3.png"></li>
        <li><img src="4.png"></li>
        <li><img src="1.png"></li>
      </ul>
    </div>
  </body>
  <script src="jquery-1.7.1.min.js"></script>
  <script>
    $("function"(){
        m=0;
        p=setInterval(go,100)
        function go(){
            m+=20;
            $("#pic").css("margin-top",-m+"px")
            if(m>=1200){m=0}
            }
      }
  </script>
</html>

jQuery kann zwei Funktionen in einem realisieren: ein Ausklappen und Schließen von Dropdown-Listen:<!DOCTYPE html>

<html>
<head>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script>
$("document").ready(function()
 {
 $("button").click(function(){
  $("#p1").css("color","red").slideUp(2000).slideDown(2000);
 });
});
</script>
</head>
<body>
<p id="p1">Spaß mit jQuery!</p>
<button>KLICK HIER</button>
</body>
</html>

Das ist alles, was ich euch zu teilen habe. Vielen Dank.

Über diese jQuery-Effekt-Funktion ist alles, was ich euch zu teilen habe. Ich hoffe, es kann euch eine Referenz sein und ich hoffe, dass ihr die Anrufe von Anrufe-Tutorial unterstützt.

Möglicherweise gefällt Ihnen auch