• 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)
    });

     
  • 相关阅读:
    1144 The Missing Number (20分)
    1145 Hashing
    1146 Topological Order (25分)
    1147 Heaps (30分)
    1148 Werewolf
    1149 Dangerous Goods Packaging (25分)
    TypeReference
    Supervisor安装与配置()二
    谷粒商城ES调用(十九)
    Found interface org.elasticsearch.common.bytes.BytesReference, but class was expected
  • 原文地址:https://www.cnblogs.com/zs0322/p/10737740.html
Copyright © 2020-2023  润新知