zoukankan      html  css  js  c++  java
  • jquery.color.js的使用

    Jquery本身不支持变色,Jquery Color.js弥补了这缺陷并为animate动画赋予变色效果,如下红变蓝后执行回调再由蓝变红。

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
        <style>
            #box {
                width:100px;
                height:100px;
                background-color:red;
                cursor:pointer;
            }
        </style>
    </head>
    <body>
        <div class="box" id="box"></div>
        <script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="/js/jquery.color.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $("#box").mouseenter(function () {
                    $(this).stop(true, true).animate({ "backgroundColor": 'blue' }, 5400, function () {
                        $(this).animate({ "backgroundColor": 'red' }, 5400);
                    });
                });
            });
        </script>
    </body>
    </html>

    支持的其他属性如下

    backgroundColor, borderBottomColor, borderLeftColor, borderRightColor, borderTopColor, color, columnRuleColor, outlineColor, textDecorationColor, textEmphasisColor

  • 相关阅读:
    2、基础知识点回顾
    jQuery事件二
    71、auth模块、bbs项目关系表
    PYthon-4.26作业
    PYthon-线程
    PYthon-4.23作业
    PYthon-4.15作业
    PYthon-4.9作业
    PYthon-4.7作业
    PYthon-3.31作业
  • 原文地址:https://www.cnblogs.com/fastmover/p/4186595.html
Copyright © 2011-2022 走看看