zoukankan      html  css  js  c++  java
  • jquery 学习(五)

    HTML + CSS 样式

    /*CSS样式*/
    <
    style> body{ margin: 0; } div{ width: 100%; height: 2000px; background-color: aquamarine; margin: 0; } .a1{ position: fixed; right: 20px; bottom: 20px; width: 90px; height: 30px; background-color: darkgoldenrod; color: white; } .ds{ display: none; } </style>
    /*HTML*/ <div></div> <div> <button class="a1 ds" onclick="f2()">返回顶部</button> </div>

    CSS操作

    //CSS 操作:
    
        //样式操作:
            $("").css({属性:值})
    
        //偏移量属性
            $("").offset.属性
            //相对于视图的偏移量
    
            $("").position.属性
            //相对于父标签的偏移量
    
        //尺寸大小
            $("").height('数值')
            $("").width('数值')
    
            $("").innerHeight('数值')
            $("").innerWidth('数值')
    
            $("").outerHeight('数值')
            $("").outerWidth('数值')
    
        //滚动条
        $("").scrollTop(数值)
        $("").scrollLeft(数值)
    
    
        //必须定义到windows事件里
        //windows onscroll 监听事件
        window.onscroll=function f() {
            var num = $(window).scrollTop();
            if (num >500){
                // $('.a1').removeClass('ds')
                $('.a1').show(1000)
            }
            else {
                // $('.a1').addClass('ds')
                $('.a1').hide(1000)
        }};
    
        function f2() {
            $(window).scrollTop(0)
        }
  • 相关阅读:
    配置centOS下的Python
    linux基础命令2
    linux基础命令1
    linux常用命令(运维用到)
    Lab 10-2
    Lab 10-1
    Lab 9-3
    archlinux 装完系统连接 wifi 网络
    arch Linux(二)
    arch Linux 安装完,无法通过 SSH 远程连接 root 用户问题
  • 原文地址:https://www.cnblogs.com/Anec/p/9870751.html
Copyright © 2011-2022 走看看