zoukankan      html  css  js  c++  java
  • 为CSS Visual Filters and Transitions 的动画添加自定义加速度

    来到新公司

    前辈派给我的第一个任务是做一个类似outlook slider的小效果  可以把两个层的变化做成动画。

    按照常理说  这个效果需要用flash来做  但是客户要求不能用脚本外的其他东西   幸好是针对ie开发  我想起来ie5.5 beta的新特性

    DirectX filters(滤镜)了。没错 M$ 5年前就提供了这个现成的效果。IE啊  你这个让人又恨又爱的东西  你不这么强大又怎么会占这么多资源你。。。你该减肥了你。。。

    具体可以参看

    http://msdn.microsoft.com/en-us/library/ms673540(VS.85).aspx 

    后面的Transitions都是动画效果哦

    只要有本地msdn的同学 都可以在本地搜索

       CSS Visual Filters and Transitions

    这个索引

    恩 标准例子如下

    Code

    http://samples.msdn.microsoft.com/workshop/samples/author/filter/Slide.htm  点此直接察看效果

    随后问题就来了   前辈要求的页面  并不是这样匀速直线的交换两个桢  而是因受力而加速的样子

    这样  Play() 命令肯定是不足以胜任的。   仔细看看参考  我发现了一个不错的切入点 

    Attributes/Properties
    Show:
    Attribute Property Description
    bands bands Sets or retrieves the number of strips into which the content is divided during the transition.
    duration Duration Sets or retrieves the length of time the transition takes to complete.
    enabled Enabled Sets or retrieves a value that indicates whether the filter is enabled.
    Percent Sets or retrieves the point in a transition at which to capture the display for a static filter output.
    slideStyle SlideStyle Sets or retrieves the method used to reveal the new content.
    status Retrieves the state of the transition.

    恩。。。。 Percent。。。  看起来很淫荡

    只要定时指派正确的percent  就可以控制速度了

    我淫荡的笑了

    于是有了下面的代码 

    Code

    恩  根据不同条件调整加速度  即可达成想要的各种效果   很有趣

    这个故事告诉我们 

    1 IE真臃肿阿,好多东西八百辈子永不到一次

    2 IE真强大阿,虽然好多东西八百辈子永不到一次

    3 知识不在新旧  用到的时候就是宝贵的知识

    4 老知识也可以通过再学习发现新的用途

    -0-  真是个啰嗦的大叔阿,写完了  希望对IE CSS感兴趣的弟妹们有帮助

  • 相关阅读:
    使用MySQL存储过程连续插入多条记录
    为什么编程语言以及数据库要从1970年1月1日开始计算时
    关于shtml页面include问题解决方案
    简单实用的FTP操作类
    js实现完美身份证号有效性验证
    .htaccess文件的建立和rewrite_module的启用
    php冒泡排序
    php实现汉诺塔问题(递归)
    简单的mysql数据库备份程序
    选择排序的php实现
  • 原文地址:https://www.cnblogs.com/waynebaby/p/1336044.html
Copyright © 2011-2022 走看看