分享按钮(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页面改成去小程序写.所以在着手开发小程序.本人也不是什么前端高手,只是一名写后端偶尔写写前端的渣渣.请前端大神们勿喷. 一.什么是微信小程序? 小程序在我的理解中只是 ...
随机推荐
- python学习之if条件句的使用
if循环 if 条件: 代码块 运行 if else的用法 if elseif else用法 if 条件1: elif 条件2: elif条件3: else:
- js 调用webservice及nigix解决跨域问题
前言 我们写一些简单的爬虫的时候会遇到跨域问题,难道我们一定要用后台代理去解决吗? 答案是否定的.python之所以适应爬虫,是因为库真的很好用. 好吧python不是今天的主角,今天的主角是js. ...
- Excel心得
智能表.数据透视表.分类汇总表是Excel最值得学的技能. 通过插入表,或者快捷键Ctrl+T/Ctrl+L,可以将区域转换为智能表,保证了字段的公式的统一,而且版式自动化处理,一深一浅.Ctrl+Q ...
- MYsql 8 连接报错 MySQLNonTransientConnectionException: Could not create connection to database server.
本地安装mysql 是8 项目中数据驱动 也要求是 8 <dependency> <groupId>mysql</groupId> <artifactId&g ...
- js面试题(转)
https://segmentfault.com/a/1190000015288700 1 介绍JavaScript的基本数据类型 Number.String .Boolean .Null.Undef ...
- Visual C++ 6.0(完整绿色版)的下载、安装和破解(图解)
vc工具的下载 链接: https://pan.baidu.com/s/1GTkcWjureiZS_2WL2dvrMw 提取码: 5859 首先点击链接下载好压缩包并解压 这里是解压好滴文件目录 双击 ...
- Django之urls.py路由配置(URLConf)
urls.py路由配置(URLConf) URL配置(URLconf)就像Django 所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表. 基本格式: Django1.x版本 ...
- 还不会K8S吗?先从kubeadm开始吧
目录 1. 准备工作 1.1 机器准备 1.2 系统配置 1.2.1 主机名及域名解析 1.2.2 免密登录 1.2.3 配置yum源 1.2.4 安装必要依赖包 1.2.5 关闭防火墙.SELinu ...
- OpenResty应用实践
一. 安装OpenResty 创建OpenResty用户 # useradd -M www -s /usr/sbin/nologin 安装OpenResty # apt-get install lib ...
- 剑指offer——数据结构
技术面重点:数组.字符串.链表.树.栈以及队列.