zoukankan      html  css  js  c++  java
  • jQuery-切换事件2

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4     <title>切换事件toggle</title>
     5     <script type="text/javascript" 
     6             src="Jscript/jquery-1.8.2.min.js">
     7     </script>
     8     <style type="text/css">
     9            body{font-size:13px} 
    10            img{border:solid 1px #ccc;padding:3px}
    11    </style>
    12     <script type="text/javascript">
    13         $(function() {
    14             $("img").toggle(function() {
    15                 $("img").attr("src", "Images/img05.jpg");
    16                 $("img").attr("title", this.src);
    17             }, function() {
    18                 $("img").attr("src", "Images/img06.jpg");
    19                 $("img").attr("title", this.src);
    20             }, function() {
    21                 $("img").attr("src", "Images/img07.jpg");
    22                 $("img").attr("title", this.src);
    23             })
    24         })
    25     </script>
    26 </head>
    27 <body>
    28      <img />
    29 </body>
    30 </html>
  • 相关阅读:
    csp-s模拟110
    csp-s模拟109
    留念
    csp-s 2019 游记
    HEOI2020
    CSP-S2019记
    堆积的$TIPS$
    低错复习
    倍增并查集
    4.26
  • 原文地址:https://www.cnblogs.com/longly/p/6597191.html
Copyright © 2011-2022 走看看