zoukankan      html  css  js  c++  java
  • jQuery

    效果:

      hide()  隐藏

        hide(2000)  ---2000为效果持续时长(毫秒)

      show()  显示

      fadeIn()  淡入

      fadeOut()  淡出

      slideUp()  向上收

      slideDown()  向下展

      animate()  通过CSS样式的渐变来创建动画效果

        animate({marginLeft:-300},"slow","linear",function(){})

        animate({marginLeft:"-300px"},1000,function(){})

          参数styles:必填,可改变的CSS样式:backgroundPosition、borderWidth、borderBottomWidth、borderLeftWidth、borderRightWidth、borderTopWidth、borderSpacing、margin、marginBottom、marginLeft、marginRight、marginTop、outlineWidth、padding、paddingBottom、paddingLeft、paddingRight、paddingTop、height、width、maxHeight、maxWidth、minHeight、minWidth、font、fontSize、bottom、left、right、top、letterSpacing、wordSpacing、lineHeight、textIndent

          参数speed:可选,动画的速度:"normal"(默认)、"slow"、"fast"、毫秒数(1000)

          参数easing:可选,设置在动画的不同点中元素的速度:"swing"(开头结尾移动慢,中间移动快)、"linear"(匀速移动)

          参数callback:可选,动画完成后要执行的函数

    事件:

      bind("事件类型1 事件类型2",fn)  绑定一个或多个事件

      on("事件类型1 事件类型2",fn)  绑定一个或多个事件

      click(fn)  点击

      mouseover(fn)  鼠标经过

      mouseout(fn)  鼠标离开

      hover(fn, fn)  鼠标经过离开切换

      toggle(fn, fn)  点击切换

    语法:

      <script>

        $(function(){

          $("谁").干什么;

        });

      </script>

      <script>

        $(function(){

          $(".aBtn").click(function(){

            $(".box").hide(1000);

          });

        });

      </script>

      index方法:index($(this))可以由代码帮你找当前对象的顺序号

        var n=$("div").index($(this));

      $("div a").eq(0).hide();  eq()---指定第几个

        children("")  子级

        parent("")  父级

        siblings("")  同辈

        next("")  下一个

        prev("")  上一个

    控制标签值

      var value=$("").val();

    控制标签的CSS修饰

      $("div a,div p").css("color","red");

      $("div a").addClass("currentA");  此处的选择器名是无需加“.”的

      $("div a").removeClass("currentA");  此处的选择器名是无需加“.”的

    控制标签属性

      $("#img01").attr("src","./images/01.png");

      $("#checked").prop("checked",true);

  • 相关阅读:
    Myeclipse10 + JBPM4.4 环境搭建图文教程
    关于ztree异步加载的问题(二)
    ztree学习之异步加载节点(一)
    【LeetCode】Search a 2D Matrix
    【LeetCode】Merge Sorted Array
    【LeetCode】Search for a Range
    一位阿里导师给大学生的忠告
    Java 基础
    java XML-RPC
    java web service
  • 原文地址:https://www.cnblogs.com/zhouwanqiu/p/8931146.html
Copyright © 2011-2022 走看看