jQuery手机端点击弹出分享按钮代码
一、HTML代码如下:
<span onClick="toshare()" style="border:dotted 1px #ddd;display:block;width:100px;text-align:center;margin:20px auto 0 auto;cursor:pointer;height:60px;line-height:60px;">点击分享到</span> <div class="am-share">
<h3 class="am-share-title">分享到</h3>
<ul class="am-share-sns">
<li><a href="#"> <i class="share-icon-weibo"></i> <span>新浪微博</span> </a> </li>
<li><a href="#"> <i class="share-icon-weibo"></i> <span>新浪微博</span> </a> </li>
<li><a href="#"> <i class="share-icon-weibo"></i> <span>新浪微博</span> </a> </li>
<li><a href="#"> <i class="share-icon-weibo"></i> <span>新浪微博</span> </a> </li>
</ul>
<div class="am-share-footer"><button class="share_btn">取消</button></div>
</div>
二、CSS代码如下:
<style type="text/css">
* { padding:; margin:; }
.am-share { font-size: 14px; border-radius:; bottom:; left:; position: fixed; text-align: center; -webkit-transform: translateY(100%); -ms-transform: translateY(100%); transform: translateY(100%); -webkit-transition: -webkit-transform 300ms; transition: transform 300ms ; width: 100%; z-index:; }
.am-modal-active { transform: translateY(0px); -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0) }
.am-modal-out { z-index:; -webkit-transform: translateY(100%); -ms-transform: translateY(100%); transform: translateY(100%) } .am-share-title { background-color: #f8f8f8; border-bottom: 1px solid #fff; border-top-left-radius: 2px; border-top-right-radius: 2px; color: #555; font-weight:; margin: 0 10px; padding: 10px 0 0; text-align: center; }
.am-share-title::after { border-bottom: 1px solid #dfdfdf; content: ""; display: block; height:; margin-top: 10px; width: 100%; } .am-share-footer { margin: 10px; }
.am-share-footer .share_btn { color: #555; display: block; width: 100%; background-color: #e6e6e6; border: 1px solid #e6e6e6; border-radius:; cursor: pointer; font-size: 16px; font-weight:; line-height: 1.2; padding: 0.625em 0; text-align: center; transition: background-color 300ms ease-out 0s, border-color 300ms ease-out 0s; vertical-align: middle; white-space: nowrap;font-family:"微软雅黑"; } .am-share-sns { background-color: #f8f8f8; border-radius: 0 0 2px 2px; margin: 0 10px; padding-top: 15px; height:auto; zoom:; overflow:auto; } .am-share-sns li { margin-bottom: 15px; display: block; float: left; height: auto; width: 25%; } .am-share-sns a { color: #555; display: block; text-decoration:none; }
.am-share-sns span { display: block; } .am-share-sns li i { background-position: center 50%; background-repeat: no-repeat; background-size: 36px 36px; background-color: #ccc; color: #fff; display: inline-block; font-size: 18px; height: 36px; line-height: 36px; margin-bottom: 5px; width: 36px; }
.am-share-sns .share-icon-weibo { background-image: url(); } .sharebg { background-color: rgba(0, 0, 0, 0.6); bottom:; height: 100%; left:; opacity:; position: fixed; right:; top:; width: 100%; z-index:; display:none; }
.sharebg-active { opacity:; display:block; } </style>
三、jQuery代码如下:
<script type="text/javascript">
function toshare(){
$(".am-share").addClass("am-modal-active");
if($(".sharebg").length>0){
$(".sharebg").addClass("sharebg-active");
}else{
$("body").append('<div class="sharebg"></div>');
$(".sharebg").addClass("sharebg-active");
}
$(".sharebg-active,.share_btn").click(function(){
$(".am-share").removeClass("am-modal-active");
setTimeout(function(){
$(".sharebg-active").removeClass("sharebg-active");
$(".sharebg").remove();
},300);
})
}
</script>
四、效果图如下:

本文摘自站长素材:http://sc.chinaz.com/jiaoben/150907458420.htm
jQuery手机端点击弹出分享按钮代码的更多相关文章
- 基于jQuery鼠标点击弹出登陆框效果
基于jQuery鼠标点击弹出登陆框效果.这是一款扁平样式风格的jQuery弹出层登陆框特效.效果图如下: 在线预览 源码下载 实现的代码. html代码: <input type=" ...
- jQuery之点击弹出图标环形菜单
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo ...
- CSS3 页面中展示邮箱列表点击弹出发送邮件界面
CSS3 页面中展示邮箱列表点击弹出发送邮件界面 代码: <!DOCTYPE html> <html> <head> <meta charset=" ...
- JS框架_(JQuery.js)Tooltip弹出式按钮插件
百度云盘 传送门 密码:7eh5 弹出式按钮效果 <!DOCTYPE html> <html > <head> <meta charset="UTF ...
- jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能示例
本文实例讲述了jQuery实现打开网页自动弹出遮罩层或点击弹出遮罩层功能.分享给大家供大家参考,具体如下: 弹出层:两种方式 一是打开网页就自动弹出层二是点击弹出 <!DOCTYPE html ...
- 点击弹出 +1放大效果 -- jQuery插件
20140110更新: <!doctype html> <html> <head> <meta charset="UTF-8"> & ...
- jquery层居中,点击小图查看大图,弹出层居中代码,顶部层固定不动,滚动条滚动情况
jquery层居中,点击小图查看大图,弹出层居中代码 http://www.cnblogs.com/simpledev/p/3566280.html 见第一版,发现一个情况,如果页面内容多出一屏的情况 ...
- jQuery点击弹出层,弹出模态框,点击模态框消失
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- jQuery第二课 点击弹出一个提示框
选择器允许您对元素组或单个元素进行操作. jQuery 选择器 在前面的章节中,我们展示了一些有关如何选取 HTML 元素的实例. 关键点是学习 jQuery 选择器是如何准确地选取您希望应用效果的元 ...
随机推荐
- AR增强现实开发介绍(续)
AR增强现实开发介绍(续) ---开发基础篇 开发增强现实技术,无论是商业级应用,还是面向幼儿教育的游戏产品,都需要从了解.获取.下载增强现实插件开始.目前全世界使用量最大公认最好的增强现实插件是高通 ...
- Windows Server 2012 R2安装SqlServer 2016
1.系统安装 微软操作系统 Windows Server 2012 R2 官方原版镜像 Windows Server 2012 R2 是由微软公司(Microsoft)设计开发的新一代的服务器专属操作 ...
- 1.2环境安装「深入浅出ASP.NET Core系列」
官网 在介绍安装环境之前,先介绍周边信息,比如微软net官网. https://www.microsoft.com/net 这个网站是学习微软技术栈比较权威的地方,包括环境下载,学习,架构,文档,社区 ...
- [转帖]无网络离线安装 vs2017
无网络离线安装 vs2017 公司电脑禁止,只有一个老的vs2017的安装目录(之前通过 --layout 安装时生成的离线文件).找了一圈百度,没能解决问题,最后,问bing,查微软的官方网站命令, ...
- 了解spring
一.spring简介 Spring是一个JavaEE轻量级的一站式的开发框架(spring的可插拔特性,企业用于整合其他框架)轻量级:使用最少的代码启动程序,根据所需选择功能选择模块使用一站式:提供了 ...
- flex-手机端主页布局实例---构造页面结构
Flexbox页面布局实例,成本效果图如下, 源码下载在最下面. 源码下载:https://pan.baidu.com/s/18o5hVuWtflUpgvMk3LzQ5w 提取码:wiyc样本地址: ...
- Kotlin 扩展——省略findViewById
现在 Kotlin 安卓扩展插件能够提供与这些开源库功能相同的体验,不需要添加任何额外代码. import kotlinx.android.synthetic.main.activity_main.* ...
- 测者的测试技术手册:测试应该关注java.util.List.subList的坑
java中有一个返回子列表的方法: public list<E> subList(int fromIndex, int toIndex){ subListRangeCheck( ...
- rocketmq延时消息
rocketmq提供一种延时消息的解决方案,就是在特定的时间到了,消息才会被投递出去供consumer消费. 总体来是简单的场景是满足了,但是需要注意的是延时的时间是需要按照默认配置的延时级别去配置的 ...
- 小程序开发基础-view视图容器
view 视图容器. // wxml <view class="section"> <view class="section__title"& ...