css3 transform气泡对话框

气泡和滑动按钮的CSS3实现
用CSS3实现Bubble气泡提示框,箭头朝上
——————————————————————
.bubble-box{
background:#EEE;
margin-bottom:30
&.bubble-box .wrap{
background:#EEE;
&.arrow-top{
&&&border-left:20px
solid #EEE;
&&&border-top:20px
solid #FFF;
&&&margin-left:20
&&width:180
&&padding:12px 10
&&margin-left:-40
——————————————————————
&div class ="bubble-box
arrow-top"&
class="wrap"&Arrow&/div&
——————————————————————
注:CSS多类选择器,类名顺序无先后,同时适用。
其它朝左朝右朝下的,原理相似。
1、边框交叉处是45°
2、最里层用margin微调。
&.arrow-left{ border-left:20px solid #FFF;
border-top:20px solid #EEE; margin-top:20}
&.arrow-right{ border-right:20px solid #FFF;
border-top:20px solid #EEE;}
&.arrow-top{ border-left:20px solid #eeE;
border-top:20px solid #FFF; margin-left:20}
&.arrow-bottom{ border-left:20px solid #EEE;
border-bottom:20px solid #FFF; margin-left:20}
&.arrow-left .wrap,
&.arrow-right .wrap{
&&& padding:12px
10px 12px 10
margin-top:-40
按钮的切换
&style text="text/css"&
.cssplayNav{
&padding:0;
&& margin:40px auto 80px
& &list-style:
& &height:50
&& width:714
&& overflow:
&& border-top:1px solid
&& border-bottom:1px solid
.cssplayNav li a{
&& display:
&& width:100
&& line-height:50
text-align:
&& font-family:arial,
&& font-size:13
text-decoration:
&& font-weight:
&& border-right:1px solid
&& border-left:1px solid
&& -moz-transition:
&& -ms-transition:
&& -o-transition:
&& -webkit-transition:
&& transition: 0.25s;
.cssplayNav li a b {
&& width:0;
height:0;&
&& border-left:50px solid
&& border-right:50px solid
&& border-bottom:20px
solid #fc6;
&& overflow:
.cssplayNav li a::before{
content:attr(rel);
&& background:#069;
&& display:
&& width:100
&& height:50
text-align:
&& background-image:
-moz-linear-gradient(-90deg, rgba(255, 255, 255,0.4), rgba(255,
255, 255,0));
&& background-image:
-webkit-linear-gradient(-90deg, rgba(255, 255, 255,0.4), rgba(255,
255, 255,0));
&& background-image:
-ms-linear-gradient(-90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
&& background-image:
-o-linear-gradient(-90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
&& background-image:
linear-gradient(-90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
255,0)); & & &
.cssplayNav li a::after{
content:attr(rel);
&& background:#fc6;
&& width:100
&& height:50
text-align:
&& background-image:
-moz-linear-gradient(0deg, rgba(255, 255, 255,0.4), rgba(255, 255,
&& background-image:
-webkit-linear-gradient(90deg, rgba(255, 255, 255,0.4), rgba(255,
255, 255,0));
&& background-image:
-ms-linear-gradient(90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
&& background-image:
-o-linear-gradient(90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
&& background-image:
linear-gradient(90deg, rgba(255, 255, 255,0.4), rgba(255, 255,
255,0)); & & &
.cssplayNav li a:hover{
&& margin-top:-70
&ul class="cssplayNav"&
&a href=""
rel="Alpha"&&b&Alpha&/b&&/a&
&a href=""
rel="Bonus"&&b&Bonus&/b&&/a&
&a href=""
rel="Cap"&&b&Cap&/b&&/a&
&a href=""
rel="Dornal"&&b&Dornal&/b&&/a&
&a href=""
rel="Facebook"&&b&Facebook&/b&&/a&
&a href=""
rel="Google"&&b&Google&/b&&/a&
&a href=""
rel="Twwiter"&&b&Twitter&/b&&/a&
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。您现在的位置: &
css3气泡 css3关键帧动画创建的动态通知气泡
css3气泡 css3关键帧动画创建的动态通知气泡
  点评:客户不得不强调以某种方式动态通知泡沫,因此我使用CSS3关键帧动画做了一个代码比较简单,感兴趣的你可以参考下,希望本文内容可以帮助到你
  最近在一个Web项目上工作时,客户不得不强调以某种方式动态通知泡沫。基本上,每一次的通知值的变化,需要的视觉效果,以获得用户的注意力。所以我做了,使用CSS3关键帧动画。代码总体比较简单,欢迎任何形式的转载,但务必说明出处
  在线演示点击下面的两个按钮 通知气泡会随时变化
  的HTML
  在这个例子中,我们将使用导航常用的标记结构  代码如下:  &ul class="menu"&
&li&&a &首页&/a&&/li&
&li&&a &关于我们&/a&&/li&
&span class="bubble"&9&/span&
&li&&a &个人中心&/a&&/li&&/ul&重点是上面的&span class=&bubble&&,这是将动画的通知气泡
  The CSS
  .animating 类 代表了一个CSS3的动画,我们使用贝塞尔曲线.来创建的,如果你是第一个接触贝塞尔曲线,可以打开学习一下  代码如下:  .animating{
animation: animate 1s cubic-bezier(0,1,1,0);
}@keyframes animate{
transform: scale(1);
transform: scale(1.7);
}}全部的 css代码  代码如下:  .animating{
-webkit-animation: animate 1s cubic-bezier(0,1,1,0);
-moz-animation: animate 1s cubic-bezier(0,1,1,0);
-ms-animation: animate 1s cubic-bezier(0,1,1,0);
-o-animation: animate 1s cubic-bezier(0,1,1,0);
animation: animate 1s cubic-bezier(0,1,1,0);
@-webkit-keyframes animate{
-webkit-transform: scale(1);
-webkit-transform: scale(1.7);
@-moz-keyframes animate{
-moz-transform: scale(1);
-moz-transform: scale(1.7);
@-ms-keyframes animate{
-ms-transform: scale(1);
-ms-transform: scale(1.7);
@-o-keyframes animate{
-o-transform: scale(1);
-o-transform: scale(1.7);
@keyframes animate{
transform: scale(1);
transform: scale(1.7);
/* ------------------------------------------- */
text-align:
margin: 50px auto 20
width: 800
padding: 0;
list-style:
border: 1px solid #111;
background-color: #222;
-moz-border-radius: 6
-webkit-border-radius: 6
border-radius: 6
-moz-box-shadow: 0 1px 1px #777, 0 1px 0 #666
-webkit-box-shadow: 0 1px 1px #777, 0 1px 0 #666
box-shadow: 0 1px 1px #777, 0 1px 0 #666
nu:before,
nu:after {
content: "";
nu:after {
border-right: 1px solid #222;
-moz-box-shadow: 1px 0 0 #444;
-webkit-box-shadow: 1px 0 0 #444;
box-shadow: 1px 0 0 #444;
padding: 12px 30
text-transform:
font: bold 12px Arial, H
text-decoration:
nu a:hover {
nu li:first-child a
-moz-border-radius: 5px 0 0 5
-webkit-border-radius: 5px 0 0 5
border-radius: 5px 0 0 5
nu .bubble
background: #e02424;
padding: 2px 6
font: bold .9em Tahoma, Arial, H
-moz-border-radius: 3
-webkit-border-radius: 3
border-radius: 3
/* Demo page only */
color: #999;
text-align:
font: 0.9em Arial, H
margin: 50px 0;
color: #777;
  The jQuery
  它不是那么容易,因为你可能会认为每次重新启动的动画时值的变化,幸好,在这个例子中,我选择的方法包括使用JavaScript的setTimeout()的方法。所以,每次通知值变化,.第二次开始的时候animating类被删除  代码如下:  var counterValue = parseInt($('.bubble'l()); // 获取当前变化的值function removeAnimation(){
setTimeout(function() {
$('.bubble').removeClass('animating')
}$('#decrease').on('click',function(){
counterValue--; // 递增
$('.bubble'l(counterValue).addClass('animating'); // 动态变化的动画
removeAnimation(); // 删除css类的动画})$('#increase').on('click',function(){
counterValue++; // 递减
$('.bubble'l(counterValue).addClass('animating'); // 动态变化的动画
removeAnimation(); // 删除css类动画
&&&主编推荐
&&&热门试卷
&&&最新视频
&&&热门阅读
&&&最新问答
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&湘教QS2-164&&增值电信业务经营许可证湘B2-html5 css3 js 动画 点击气泡后 气泡会爆炸气泡一直往上冒泡 点击气泡后 气泡酒爆炸 ,有老师会写吗 ?&_百度作业帮
html5 css3 js 动画 点击气泡后 气泡会爆炸气泡一直往上冒泡 点击气泡后 气泡酒爆炸 ,有老师会写吗 ?&
如果要爆炸效果,替换相应图片即可.参考:/topic/1112322Hotspotter - jquery创建图片热点插件
Hotspot Map
强大的图片热点注释和提示工具
Wah-Menu漂亮的jQuery侧边栏菜单
jquery滚动到页脚弹出气泡提示层动画
CSS3引导动画|弹出遮罩层
你可能还喜欢
键盘快捷键: & 上一个 下一个 &}

我要回帖

更多关于 css3 transform 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信