• 笔记(相似与区别)


    1,$(document) 获取文档对象

       $(window)获取窗口对象 

       试试$(document).height()和$(window).height()就知道区别了。

    2,$(document).ready() 表示文档结构已经加载完成(不包含图片等非文字媒体文件)

       $(document).load() 表示页面包含图片等文件在内的所有元素都加载完成

       $(function(){})等价于$(document).ready(function(){})

    3,jQuery中.bind() .live() .delegate() .on()的区别

    4,事件委托

      a,普通绑定事件

          $(document).ready(function(){
              $("td").bind("click",function(){
                  $(this).text("时光漫步");
          })

      b,事件委托(要处理的事件委托给父元素或者祖先元素,即为父元素绑定事件侦听)

          $(document).ready(function(){

        $("table").bind("click",function(e){

          var target=e.target;  //target 属性规定哪个 DOM 元素触发了该事件

          $target=$(target);  //转成jquery对象

            if($target.is("td")){

            $target.text("时光漫步");

          }

        })

      })

    5,setTimeout(表达式,延时时间)在执行时,是在载入后延迟指定时间后,去执行一次表达式,记住,次数是一次 ;

      setInterval(表达式,交互时间)则不一样,它从载入后,每隔指定的时间就执行一次表达式。 

    6,null:表示一个‘无’的对象,转为数值为0;undefined表示无值,转为数值为NaN。

  • 相关阅读:
    spring boot 集成 kaptcha
    3.1 表格类数据
    3.0 本章介绍
    2.9 tensor API简介
    2.8 将tensor移动到GPU上
    2.7 序列化(保存)tensor
    2.6 与numpy交互
    2020-7-22 头条 JAVA 后端面试
    API 设计最佳实践的思考
    ESXi 安装网卡vib驱动文件
  • 原文地址:https://www.cnblogs.com/colima/p/5048744.html
Copyright © 2020-2023  润新知