zoukankan      html  css  js  c++  java
  • js 面向对象

    1.面向对象(伪面向对象)
        
        原型
        
            function Animal(name,age){
                this.name = name;
                this.age = age;
            };
            Animal.prototype.showName = function(){
                console.log(this.name);
            
            }
            var a  = new Animal();
            a.showName()
            
            
        
        字面量方式创建
            var obj = {
                name:'alex',
                age:18,
                fav:function(){
                    
                }
            };
            
            
        2.定时器
            setTimeout() 一次性定时器
            setInterval() 循环周期的定时器
            
            使用定时器: 上来先清定时器 clearInterval(),再开定时器
        3.BOM
        
        open();
        
        location.href = '地址'
        
        
    今日内容:
    
        使用第一步 1.引包
        <script src="jquery.js"></script>
        
        2.使用 
            入口函数
            $(document).ready(function(){});
            
            $(function(){})
            
            
        三步走:
        1.事件对象
            
            $(选择器) 返回的是jquery对象
            
        2.js转jquery  $(js对象)
        jquery转js  $(选择器)[0]
        小心this
        
        3.// jquery 链式编程
                    $(this).css({
                        'backgroundColor':'green',
                        'width':'300px'
                    }).attr('id','box');
        
        4.jquery的筛选选择器和基本过滤器
            siblings 选中兄弟元素  除了自己 使用它来做选项卡 排他思想
            
        5.jquery的动画
            show()
            hide()
            slideDown()
            slideUp()
            fadeIn()
            fadeOut()
            animate() 自定义动画
            
  • 相关阅读:
    Something about the "BSTR" and "SysStringLen"
    关于 i = i ++ 的问题
    duilib写个三国杀?
    关于WM_GETTEXT的应用
    hoops暂时用过的一些方法
    Hoops随便记的
    C++ win32线程数上限
    windows系统时间(SYSTEMTIME)
    Form表单提交的那些事
    多行文字溢出...
  • 原文地址:https://www.cnblogs.com/ltk-python/p/9506676.html
Copyright © 2011-2022 走看看