zoukankan      html  css  js  c++  java
  • jQuery_简介_选择器

    【JS类库】

      作用:简化javascript的操作

      内容:预定义了许多对象(属性和方法)和函数  

      特点:兼容各大浏览器

    【jQuery概述】

      【分类】

      -  jQuery - Web版本

      -  jQuery UI - 集成UI内容

      -  jQuery Mobile - 移动版本

      -  Qunit - 用于测试

      【使用方法】

      -  在HTML页面引入jQuery文件

      -  使用jQuery的选择器定位(获取)页面元素

      -  使用jQuery的API完成需求

      【基本内容】

        【$(selector)】

        -  jQuery的工厂函数,返回jQuery对象

        【DOM对象和jQuery对象】

        -  DOM对象:通过DOM获取的元素,称为DOM对象

        -  jQuery对象:通过jQuery包装DOM产生的对象,底层仍然是DOM对象

        -  【DOM对象和jQuery对象的转换】

          DOM->jQuery:$(DOM对象)

          jQuery->DOM:

            jQuery对象是数组,使用角标

            jQuery对象提供get(index)方法

        【jQuery事件】

        -  将DOM事件封装成对应的方法

    【选择器】

      学会使用选择器是学习jQuery的基础

      $(selector)

      【基本选择器】

        【id选择器】$("#id")

        【类选择器】$(".class")

        【元素选择器】$("elementName")

        【通配符选择器】$("*")

        【合并选择器】$(selector1,selector2,...)

      【层次选择器】

        【后代节点选择器】$(selector1 selector2)

        【子节点选择器】$(selector1>selector2)

        【相邻节点选择器】$(selector1+selectro2)

        【后兄弟节点选择器】$(selector1~selector2)

      【过滤选择器】":"开头

        【基本过滤选择器】

        -  :first

        -  :last

        -  :not(selector)

        -  :even       挑选偶数行(从0开始)

        -  :odd         挑选奇数行

        -  :eq(index)     下标是index的元素

        -  :gt(index)      下标大于index的元素

        -  :lt(index)     下标小于index的元素 

        -  :header      标题元素

        -  :animated     正在执行动画的元素 

        【子元素过滤选择器】

        -  :nth-child(index)  从1开始

        -  :first-child

        -  :last-child

        -  :only-child

        【内容过滤选择器】

        -  :contains(text)

        -  :empty

        -  :has

        -  :parent  含有子元素或文本的

        【可见性过滤选择器】

        -  :hidden

        -  :visible

        【属性过滤选择器】

        -  [attribute]

        -  [attribute=value]

        -  [attribute!=value]

        -  [attribute^=value]

        -  [attribute$=value]

        -  [attribute*=value]

        -  [attrSelector1][attrSelector2]...

        【表单对象过滤选择器】

        -  :enabled  

        -  :disabled

        -  :checked

        -  :selected

      【表单选择器】

        -  :input

        -  :text

        -  :password

        -  ...

  • 相关阅读:
    Zoj 3511 线段树
    HDU 3340 Rain in ACStar 线段树+简单几何?
    BZOJ 2282 & 树的直径
    BZOJ 1121 & science
    BZOJ 1067 & Interval_Tree
    BZOJ 1001 & SPFA
    UVa 11181 条件概率
    并查集——启发式合并,路径压缩
    GSS系列(1)——GSS1&&GSS3
    评测脚本
  • 原文地址:https://www.cnblogs.com/controlms/p/7840618.html
Copyright © 2011-2022 走看看