zoukankan      html  css  js  c++  java
  • 419 JQuery and BootStrap

    把葵花宝典剩下的知识讲完了 又学习了bootstrap

    <link rel="stylesheet" href="css/bootstrap.css">
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script type="text/javascript" src="js/jquery-3.4.0.min.js"></script>

    三个文件必须要导入 :1: .CSS

    2:bootstrap.js : CSS/HTML框架 前端网页框架 提供

    3:jquery-3.4.0min.js :javascript的一个类库

    js页面简便加载  window.onload=function(){}

    jQuery页面简便加载:$(function(){})

    二者相等 但只能二选一 

    jQuery 葵花宝典    

    js 和 jquery主要的区别 在 dom
    想用jquery 必须先引入(顺序问题)
    先css 在js: 先框架css再自己css 先jquery 在框架 在自己

    找元素:
    js:
    document.getElement[s]By... id tagname name classname
    jquery:
    $(选择器) $(选择器).eq(下标)
    js找到的是js对象 jquery找到的是jquery对象
    相互转 js->jquery $(jsDom)
    jquery->js $('div')[0] $('div').get(0)
    两个对象 jsDom jqDom
    操作内容:
    jsDom.innerHtml = 赋值
    jsDmo.value
    jqDom.html() jqDom.html('赋值')
    jqDom.val() jqDom.val('赋值')
    操作样式
    jsDom.style.color = 赋值 //只能操作行内样式
    jqDmo.css('color'); jqDmo.css('color','red');
    jqDom.removecss('color')
    jqDmo.css({
    'color' : 'red',
    'width' : '100px'
    ...
    });
    操作属性
    jsDom.getAttribute('class');
    jsDom.setAttribute('class','add');
    jsDom.removeAttribute('class');

    jqDom.attr('class');
    jqDom.attr('class','add');
    jqDom.attr({
    'data' : 'add',
    'id' : 'add',
    ...
    });
    jQDom.removeAttr('class')
    jqDom.addclass('del')


    操作事件
    jsDom.onClick = function(){
    this
    }
    jqDom.click(function(){
    $(this)
    });

     
  • 相关阅读:
    arm-linux-3.4.2移植for2440
    编译内核是出现:arch/arm/mm/tlb-v4wbi.S:64:error: too many positional arguments
    poj3050 Hopscotch
    poj3187 Backward Digit Sums
    poj2718 Smallest Difference
    hihocoder offer收割编程练习赛10 C 区间价值
    poj1862 Stripies
    poj3262 Protecting the Flowers
    poj2229 Sumsets
    poj2385 Apple Catching
  • 原文地址:https://www.cnblogs.com/zs0322/p/10737740.html
Copyright © 2011-2022 走看看