jquery实现来回翻转效果
来源:互联网 发布:itools怎么下载软件 编辑:程序博客网 时间:2024/04/29 16:49
demo代码如下: 注意:是通过判断是否存在某种ID值,然后添加id实现的。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <scrip class="sr"></scrip> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <style type="text/css"> .box { width: 200px; height: 200px; position: relative; } .box1,.box2 { width: 200px; height: 200px; position: absolute; top: 0; left: 0; text-align: center; line-height: 200px; font-size: 50px; backface-visibility: hidden; background: red; transition: all 3s; } .box1 { background: red; transform: rotateY(-180deg); } .box2 { background: blue; } #box2 { transform: rotateY(180deg); } #box1 { transform: rotateY(0deg); } </style> </head> <body> <div class="box"> <div class="box1">CCCC</div> <div class="box2">BBBB</div> </div> <script type="text/javascript"> $(".box").click(function(){ if($(".box1").attr("id") == undefined || $(".box1").attr("id") === ""){ $(".box1").attr("id","box1"); }else if($(".box1").attr("id") === "box1") { $(".box1").attr("id",""); } if($(".box2").attr("id") == undefined || $(".box2").attr("id") === "box1"){ $(".box2").attr("id","box2"); }else if($(".box2").attr("id") === "box2") { $(".box2").attr("id","box1"); } }); </script> </body> </html>
阅读全文
0 0
- jquery实现来回翻转效果
- jquery实现简单的图片翻转效果
- iOS 基于UIView抖动 来回移动 缩放 翻转效果
- silverlight实现翻转效果
- UIView翻转效果实现
- UIView翻转效果实现
- UIView翻转效果实现
- iphone--UIView翻转效果实现
- cocos2d 如何实现 翻转效果
- 图片翻转效果的实现
- CSS3实现翻转(Flip)效果
- CSS3实现翻转(Flip)效果
- css实现翻转卡片效果
- CSS3实现徽章翻转效果
- jQuery图片翻牌品牌翻转切换效果
- JQuery实现的图片翻转
- 实现Gmail邮箱翻转效果之翻转动画
- IOS翻转动画(可来回切换图片)
- 关于小班研讨课的感受
- leetcode 517. Super Washing Machines 超级洗衣机
- IDA出现"sp-analysis failed"和F5(反编译)失败
- 使用VS2013调用opencv3.3.0时出现的问题及解决办法
- Android 资源网站
- jquery实现来回翻转效果
- HDU(3592)---POJ (3169) Layout 差分约束系统
- 3. Longest Substring Without Repeating Characters
- Lnmp常用小知识
- CocosCreator学习2:场景的创建和切换
- 第三章 资源管理
- C指针分享之“复杂指针”
- redis集群哨兵模式
- CocosCreator零基础制作游戏《极限跳跃》二、制作游戏开始场景