zoukankan      html  css  js  c++  java
  • 【Jquery】jquery动画效果animate

    渐渐的拉长:

    <div class="close-sidebar"><a href="#">关闭侧边栏</a></div>
    <div class="show-sidebar" style="display:none;"><a href="#">显示侧边栏</a></div>
       
        <script src="js/jquery.js"></script>
        
        <script type="text/javascript">
                $(document).ready(function () {
                               
    jQuery(document).ready(function($) {
        $('.close-sidebar').click(function() {
            $('.close-sidebar,.sidebar').hide();
            $('.show-sidebar').show();
            $('#shop_content').animate({
                 "66%"
            },
            1000);
        });
        $('.show-sidebar').click(function() {
            $('.show-sidebar').hide();
            $('.close-sidebar,.sidebar').show();
            $('#shop_content').animate({
                "40%"
            },
            1000);
        });
    });
    });
            
        </script>

    
    

    其中#shop_content为你的html中的某个div的id,然后你就随便发挥吧,各种属性,神马marginLeft,marginTop,随便玩,自己搜下animate的api

  • 相关阅读:
    JS-常用的数据结构之线性表
    Django 数据库增删改查
    Django 静态文件配置及request初识
    Django 基础
    jQuery
    前端之BOM和DOM
    前端js
    前端 css
    前端基础 html
    进度条
  • 原文地址:https://www.cnblogs.com/ae6623/p/4416519.html
Copyright © 2011-2022 走看看