分享按钮(QQ,微信,微博等)移入动画效果
ps:最近写的很多博客都是在以前在项目里写过的,之所以现在写出来,最大的目的就是希望自己以后用到的时候比较容易找,而且现在再写一遍,有助于加深印象!
很简单的效果,说先实现方式:
1.图标来自 阿里巴巴矢量图标库 没用过的可以试下,各式各样的图标,非常好用
2.初始每个分享框左右两侧都有一个隐藏的图标,和隐藏的文字
3.js操作鼠标移入时,图标和文字移动,将隐藏的显示,显示的隐藏
4.css3的transition
先看下效果吧:
1这是鼠标未移入时

2.鼠标移入(动画效果演示不了。。。)

代码如下:
css:
@font-face {
font-family: 'iconfont'; /* project id 219179 */
src: url('http://at.alicdn.com/t/font_dh783vq4jh7rdx6r.eot');
src: url('http://at.alicdn.com/t/font_dh783vq4jh7rdx6r.eot?#iefix') format('embedded-opentype'),
url('http://at.alicdn.com/t/font_dh783vq4jh7rdx6r.woff') format('woff'),
url('http://at.alicdn.com/t/font_dh783vq4jh7rdx6r.ttf') format('truetype'),
url('http://at.alicdn.com/t/font_dh783vq4jh7rdx6r.svg#iconfont') format('svg');
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.servicesBox {
width: 1000px;
height: 270px;
margin: auto;
clear: both;
line-height: 18px;
color: #;
font-size: 12px;
}
.servicesBox .serBox {
cursor: pointer;
border: 1px solid #fff;
display: inline;
width: 100px;
height: 135px;
float: left;
overflow: hidden;
background-color: #f7f7f7;
position: relative;
}
.servicesBox .serBoxOn {
font-family: "微软雅黑";
opacity:;
width: 100px;
height: 135px;
background: #f48080;
position: absolute;
left: 0px;
top: 0px;
z-index: ;
transition:all linear .5s;
}
.servicesBox .serBox .pic1 {
width: 100px;
height: 100px;
text-align: center;
position: absolute;
top: 43px;
z-index: ;
transition:all linear .25s;
left: 0px;
}
.servicesBox .serBox .pic2 {
width: 100px;
height: 100px;
text-align: center;
position: absolute;
top: 43px;
left: -100px;
z-index: ;
transition:all linear .25s;
}
.servicesBox .serBox .pic2 i{
color:#fff;
}
.servicesBox .serBox .txt2 {
width: 100px;
height: 30px;
color: #fff;
position: absolute;
top: 97px;
left:100px;
z-index: ;
transition:all linear .25s;
}
.servicesBox .serBox .txt1 {
width: 100px;
height: 30px;
color: #;
position: absolute;
top: 97px;
left: 0px;
z-index: ;
transition:all linear .25s;
}
.servicesBox .serBox .txt1 .tit {
color: #;
line-height: 30px;
}
.servicesBox .serBox span.tit {
font-size: 16px;
display: block;
text-align: center;
}
.servicesBox .serBox .txt2 .tit{
color:#fff;
line-height: 30px;
font-weight:bold;
}
.servicesBox .serBox p {
padding: 10px;
text-align: center;
}
.serBox i{
font-size:75px;
}
.serBox:hover .serBoxOn{
opacity: ;
}
html
<div class="servicesBox">
<div class="serBox"> <div class="serBoxOn"></div> <div class="pic1" > <i class="iconfont"></i> </div> <div class="pic2"> <i class="iconfont"></i> </div> <div class="txt1"> <span class="tit">QQ</span></div> <div class="txt2"><span class="tit">QQ</span></div> </div>
<div class="serBox"> <div class="serBoxOn"></div> <div class="pic1" > <i class="iconfont"></i> </div> <div class="pic2" > <i class="iconfont"></i> </div> <div class="txt1" > <span class="tit">微博</span></div> <div class="txt2" ><span class="tit">微博</span></div> </div>
<div class="serBox"> <div class="serBoxOn"></div> <div class="pic1" > <i class="iconfont"></i> </div> <div class="pic2" > <i class="iconfont"></i> </div> <div class="txt1" > <span class="tit">微信</span></div> <div class="txt2" ><span class="tit">微信</span></div> </div>
</div>
js:
$(".serBox").mouseover(function(){
$(this).children(".pic1").css("left","100px")
$(this).children(".pic2").css("left","")
$(this).children(".txt1").css("left","-100px")
$(this).children(".txt2").css("left","")
})
$(".serBox").mouseout(function(){
$(this).children(".pic1").css("left","");
$(this).children(".pic2").css("left","100px")
$(this).children(".txt1").css("left","")
$(this).children(".txt2").css("left","-100px")
})
分享按钮(QQ,微信,微博等)移入动画效果的更多相关文章
- Oauth2.0 QQ&微信&微博实现第三方登陆
一.写在前面 目前对于大多数的App或Web网站都支持有第三方登陆这个功能,用户可使用 QQ/ 微信/ 微博 帐号快速登录你的网站,降低注册门槛,为你的网站带来海量新用户.最近在新项目上刚好用到了,在 ...
- 访问量分类统计(QQ,微信,微博,网页,网站APP,其他)
刚准备敲键盘,突然想起今天已经星期五了,有点小兴奋,一周又这么愉快的结束,又可以休息了,等等..我好像是来写Java博客的,怎么变成了写日记,好吧,言归正传. 不知道大家有没有遇到过这样的需求:统计一 ...
- qq 微信 微博 第三方分享
<html> <head> <meta charset="utf-8"> <meta name="viewport" ...
- 【Android UI设计与开发】第03期:引导界面(三)仿微信引导界面以及动画效果
基于前两篇比较简单的实例做铺垫之后,这一篇我们来实现一个稍微复杂一点的引导界面的效果,当然也只是稍微复杂了一点,对于会的人来说当然还是so easy!正所谓会者不难,难者不会,大概说的就是这个意思了吧 ...
- Android仿QQ窗口的抖动的动画效果
就是仿照QQ窗口的抖动效果,在项目的res下创建anim文件夹,再创建两个xml文件:cycle.xml . myanim.xml cycle.xml : <?xml version ...
- 分享-QQ/微信/微博(环境搭建)
QQ环境搭建
- Python 第三方登录 实现QQ 微信 微博 登录
本人写的AgentLogin,能快速返回QQ.微信.微博第三方用户名信息,主要用于快速登录 用 pip命令安装 pip install AgentLogin 用法 : 导入这个包 from Agent ...
- TP QQ 微信 微博登录
use Org\Util\QQconnect; use Org\Util\Wechatauth; use Org\Util\SaeTOAuthV2; use Org\Util\SaeTClientV2 ...
- 微信小程序的动画效果
前言 由于公司计划有变,所以从H5页面改成去小程序写.所以在着手开发小程序.本人也不是什么前端高手,只是一名写后端偶尔写写前端的渣渣.请前端大神们勿喷. 一.什么是微信小程序? 小程序在我的理解中只是 ...
随机推荐
- java 获取请求ip,服务本地ip
/** * 获取请求IP * * @param request * @return */ public static String getRequestIpAddress(HttpServletReq ...
- 弹性式数据集RDD
弹性式数据集RDD 一.RDD简介二.创建RDD 2.1 由现有集合创建 2.2 引用外部存储系统中的数据集 2.3 textFile & who ...
- yum命令无效
无论执行任何yum命令都无效,弄了两个小时.主要的方案有: 方案1:yum clean all 并查询repo中是否有enabled=0: https://unix.stackexchange.com ...
- Oracle百万数据查询语句
SELECT * FROM (SELECT e.*, ROWNUM rn FROM (SELECT id, name, age, birthDate, sex, describe, city, cre ...
- class.getFields和class.getDeclareFields的区别
class.getFields的定义 返回类提供的public域包括超类的共有变量; 注: 是public,我们平时定义变量一般用的private,如果用getFields是不会获得. class.g ...
- java新学者(二)
一.构造方法的特点 创建新的对象 A a =new A (); 二.抽象类和抽象方法的特点是什么? .抽象类使用abstract修饰: .抽象类不能实例化,即不能使用new关键字来实例化对象: .含有 ...
- 基于 abp vNext 和 .NET Core 开发博客项目 - 统一规范API,包装返回模型
上一篇文章(https://www.cnblogs.com/meowv/p/12916613.html)使用自定义仓储完成了简单的增删改查案例,有心的同学可以看出,我们的返回参数一塌糊涂,显得很不友好 ...
- CF948B Primal Sport
题目链接:http://codeforces.com/contest/948/problem/B 知识点: 素数 解题思路: \(f(x)\) 表示 \(x\) 的最大素因子.不难想到:\(X_1 \ ...
- Hystrix入门
hystrix对应的中文名字是“豪猪”,豪猪周身长满了刺,能保护自己不受天敌的伤害,代表了一种防御机制,这与hystrix本身的功能不谋而合,因此Netflix团队将该框架命名为Hystrix,并使用 ...
- python爬虫需要掌握哪些知识点
1.熟练掌握Python语言 2.熟练掌握JS/HTML/CSS,了解HTTP协议. 3.熟练使用chrome 4.爬虫框架 推荐几个大神的教学干货,大家共同进步! https://zhuanlan. ...