>>分享Web前端开发技术,并对孙卫琴的《精通Vue.js:Web前端开发技术详解》提供技术支持 书籍支持  卫琴直播  品书摘要  在线测试  资源下载  联系我们
发表一个新主题 开启一个新投票 回复文章 您是本文章第 25827 个阅读者 刷新本主题
 * 贴子主题:  jQuery UI 范例:颜色动画(Color Animation) 回复文章 点赞(0)  收藏  
作者:sunshine    发表时间:2019-08-12 21:15:50     消息  查看  搜索  好友  邮件  复制  引用

  

jQuery UI 范例 -  颜色动画(Color Animation)

         使用 .animate() 实现颜色动画效果。

         如需了解更多有关颜色动画(Color Animation)的细节,请查看 API 文档 颜色动画(Color Animation)

         jQuery UI 捆绑了 jQuery Color 插件,jQuery Color 插件提供了颜色动画及其他许多与颜色相关的实用功能。                    

动画(Animation)演示

     点击按钮预览特效。

<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>jQuery UI 特效 - 动画(Animation)演示</title>

  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/jquery-1.9.1.js"></script>

  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

  <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">

  <style>

    .toggler { width: 500px; height: 200px; position: relative; }

    #button { padding: .5em 1em; text-decoration: none; }

    #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; background: #fff; }

    #effect h3 { margin: 0; padding: 0.4em; text-align: center; }

  </style>

  <script>

  $(function() {

    var state = true;

    $( "#button" ).click(function() {

      if ( state ) {

        $( "#effect" ).animate({

          backgroundColor: "#aa0000",

          color: "#fff",

          width: 500

        }, 1000 );

      } else {

        $( "#effect" ).animate({

          backgroundColor: "#fff",

          color: "#000",

          width: 240

        }, 1000 );

      }

      state = !state;

    });

  });

  </script>

</head>

<body>

         <div class="toggler">

  <div id="effect" class="ui-widget-content ui-corner-all">

    <h3 class="ui-widget-header ui-corner-all">动画(Animation)</h3>

    <p>

      Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.

    </p>

  </div>

</div>

   <a href="#" id="button" class="ui-state-default ui-corner-all">切换特效</a>

</body>

</html>

程序猿的技术大观园:www.javathinker.net



[这个贴子最后由 flybird 在 2020-02-26 11:31:43 重新编辑]
  Java面向对象编程-->图形用户界面(上)
  JavaWeb开发-->JSP技术详解(Ⅰ)
  JSP与Hibernate开发-->Java应用分层架构及软件模型
  Java网络编程-->通过JDBC API访问数据库
  精通Spring-->Vue Router路由管理器
  Vue3开发-->Vue指令
  vue3.0-基本特性和用法
  常用CSS样式属性大全
  Vue3.0里为什么要用 Proxy API 替代 defineProperty API ? ...
  07、手把手教Vue--路由「Vue-router」 - TigerChain
  Vue CLI项目的package.json中版本号详解~和^和*的区别
  Axios拦截器的用法
  JavaScript实现睡眠函数
  vue中axios异步调用接口的坑
  Vue项目的性能优化之路
  一个AJAX入门范例
  jQuery 效果:隐藏和显示
  jQuery UI 范例:show()方法
  JavaScript prototype(原型对象)
  JavaScript HTML DOM EventListener
  JavaScript 正则表达式
  更多...
 IPIP: 已设置保密
楼主      
1页 0条记录 当前第1
发表一个新主题 开启一个新投票 回复文章


中文版权所有: JavaThinker技术网站 Copyright 2016-2026 沪ICP备16029593号-2
荟萃Java程序员智慧的结晶,分享交流Java前沿技术。  联系我们
如有技术文章涉及侵权,请与本站管理员联系。