最近看了一些关于分享自媒体的代码,最后在在项目中使用了百度的分享代码,百度分享的代码格式,如下

通过config,可以对分享链接、分享图片、分享描述、分享渠道等信息进行配置。具体可以参考百度分享代码的文档

http://share.baidu.com/code/advance#config

我这边在实际使用中,并没有进行过多的配置,而是采用css重写部分样式的方式来制作。

以下我这边的demo展示效果图

大概就是长这个样式,具体代码如下:

html:

移动百度分享demo

分享

css

html{font-size:10px;}html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin:0; padding:0; border:0; font-weight: normal; vertical-align:baseline;}article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block;}body {font-family:"Microsoft YaHei", Arial, Helvetica, sans-serif; background:#f5f5f5;}ol, ul { list-style:none;}em, i{font-style: normal;}blockquote, q { quotes:none;}blockquote:before, blockquote:after, q:before, q:after { content:''; content:none;}table { border-collapse:collapse; border-spacing:0;}* { tap-highlight-color:rgba(0, 0, 0, 0); -webkit-tap-highlight-color:rgba(0, 0, 0, 0); -webkit-box-sizing:border-box; box-sizing:border-box;}input, textarea { outline:0; resize:none; -webkit-appearance: none;}img{vertical-align: middle;}a{display: block; color: #333; text-decoration: none;}/*以下是样式代码*/#share{margin: 50px;text-align: center;}.screenW{width: 100%; height: 100%; position: fixed; left: 0; top: 0; background-color: rgba(0,0,0,0.5); z-index: 999; display: none;}.subW{width: 100%; height: 260px; position: absolute; left: 0; bottom: -260px; background-color: #FFF; z-index: 999;}.subW.move{ animation:sidebar-move .5s ease; -webkit-animation:sidebar-move .5s ease; bottom:0px;}.subW.back{ animation:sidebar-back .5s ease; -webkit-animation:sidebar-back .5s ease; bottom:-260px;}.subW .title{width: 100%; height: 40px; line-height: 40px; text-align: center; font-size: .4rem;}.subW .close{width: 100%; height: 40px; line-height: 40px; text-align: center; font-size: .4rem; color: #FFF; background: #2fc7c9;}.subW .info{width:100%; height: 220px; padding: 0 10px;}/*以下是对百度自带样式的改造*/.shareBox .bdshare-button-style0-16{ background-image: -webkit-linear-gradient(bottom,rgba(0,0,0,.1) 50%,transparent 50%); background-image: linear-gradient(bottom,rgba(0,0,0,.1) 50%,transparent 50%); background-size: 100% 1px; background-repeat: no-repeat; background-position: left bottom; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex;}.shareBox .bdshare-button-style0-16:last-child{background: none;}.shareBox .bdshare-button-style0-16:after{ content: ""; visibility: hidden; display: none; height: 0; clear: both;}.shareBox .bdshare-button-style0-16 a{ text-align: center; float: none; font-size: 12px; padding: 35px 0 0 0; line-height: normal; height: auto; cursor: pointer; margin: 10px 0; position: relative; background: none; -webkit-box-flex:1; -webkit-flex:1; flex:1;}.shareBox .bdshare-button-style0-16 a:after{ content: " "; width:30px; height:30px; position: absolute; left: 50%; top: 0px; -webkit-transform: translate(-50%,0); transform: translate(-50%,0);}.shareBox .bdshare-button-style0-16 a.bds_qzone:after{ background: url("../img/icon_qqkongjian_yellow.png") no-repeat; background-size: 100%;}.shareBox .bdshare-button-style0-16 a.bds_tsina:after{ background: url("../img/icon_xinlangweibo_red.png") no-repeat; background-size: 100%;}.shareBox .bdshare-button-style0-16 a.bds_sqq:after{ background: url("../img/icon_qqhaoyou_blue.png") no-repeat; background-size: 100%;}.shareBox .bdshare-button-style0-16 a.bds_tqq:after{ background: url("../img/icon_qqweibo_green.png") no-repeat; background-size: 100%;}.shareBox .bdshare-button-style0-16 a.bds_weixin:after{ background: url("../img/icon_weixin_green.png") no-repeat; background-size: 100%;}.shareBox .bdshare-button-style0-16 a.popup_more{width: 100%; margin: 20px 0;}.shareBox .bdshare-button-style0-16 a.popup_more:after{ width:40px; height:40px; position: absolute; left: 50%; top: 0px; background: url("../img/icon_more_orange.png") no-repeat; background-size: 100%;}/*动画*/@keyframes sidebar-move { 0% { bottom:-260px; } 100% { bottom:0px; }}@keyframes sidebar-back { 0% { bottom:0px; } 100% { bottom:-260px; }}@-webkit-keyframes sidebar-move { 0% { bottom:-260px; } 100% { bottom:0px; }}@-webkit-keyframes sidebar-back { 0% { bottom:0px; } 100% { bottom:-260px; }}

js

(function() { var main = { node: { closeBtn: $('.close'), screenW: $('.screenW'), subW: $('.subW'), share: $('#share'), shareBox: $('.shareBox') }, /*入口*/ init: function() { var self = this; self.closeTap(); self.shareTap(); }, /*分享点击弹窗*/ shareTap: function() { var self = this; self.node.share.on('tap', function() { self.wShow(); self.node.shareBox.show().siblings().hide(); }); }, /*点击关闭弹窗*/ closeTap: function() { var self = this; self.node.closeBtn.on('tap', function() { self.wHide(); }); }, /*窗口显示*/ wShow: function() { var self = this; self.node.screenW.show(); self.node.subW.addClass('move').removeClass('back'); }, /*窗口隐藏*/ wHide: function() { var self = this; self.node.subW.addClass('back').removeClass('move'); setTimeout(function() { self.node.screenW.hide(); }, 500); } }; /*商品js入口*/ main.init(); /*百度分享js*/ window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "sqq", "tqq", "weixin"], "viewText": "分享到:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "sqq", "tqq", "weixin"] } }; with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];})();

下载地方放到csdn上去了,地址为

http://download.csdn.net/detail/hufengsky123/9270163

百度网页移动端html,移动端使用百度分享代码_html/css_WEB-ITnose相关推荐

  1. 打开百度网页为什么显示114导航 管理 服务器,百度为什么老是提示当前上网被劫持...

    老万 Q:最近在通过百度进行信息搜索的时候,它总是提示"当前上网设备使用的网络环境可能存在劫持".那么为什么会出现这样的情况?我们又应该如何解决这个问题呢? A:出现网络劫持的情况 ...

  2. chrome浏览器无法加载百度网页启动组件怎么办

    chrome浏览器无法加载百度网页启动组件怎么办 chrome浏览器无法加载百度网页启动组件怎么办?chrome浏览器百度打不开提示无法加载百度网页启动组件怎么办?使用chrome浏览器打开百度的时候 ...

  3. 百度网页移动端html,百度移动端开始用网站品牌名代替网址显示

    最近,有站长发现,百度移动端最近做了部分改版:移动端部分网站域名开始逐渐被网站相关名称代替,PC端还是用域名展示,卢松松博客网站域名也被替换成网站品牌名显示! 不知道站长们,最近有没有注意到,百度移动 ...

  4. [干货]网页端、移动端导航设计模式全解

    界面中的组件设计有很多通用的交互设计模式. 产品导航做为界面上最常见的组件同样也有多种被大家熟知的设计模式,模式化的组件为产品经理快速.有效的创建产品界面.构建信息架构提供的方便的应用. 接下来,我们 ...

  5. 【移动端网页布局】移动端网页布局基础概念 ① ( 移动端浏览器 | 移动端屏幕分辨率 | 移动端网页调试方法 )

    文章目录 一.移动端浏览器 二.移动端屏幕分辨率 三.移动端网页调试方法 一.移动端浏览器 移动端浏览器 比 PC 端浏览器发展要晚 , 使用的技术比较新 , 对 HTML5 + CSS3 支持较好 ...

  6. 网页端、移动端导航设计模式全解

    ​界面中的组件设计有很多通用的交互设计模式. 产品导航做为界面上最常见的组件同样也有多种被大家熟知的设计模式,模式化的组件为产品经理快速.有效的创建产品界面.构建信息架构提供的方便的应用. 接下来,我 ...

  7. android 百度转码,自适应网站移动端被百度转码解决方案

    前段时间1月10号的时候,突然发现我的自适应的博客移动端被百度转码了,移动端被转码是每个站长都头疼的问题,这意味着,页面不够美观,而且会被植入百度广告,而流失属于我们自己的流量.特别是当你的站点已经提 ...

  8. 360浏览器打不开网页_苹果移动端、PC端safari浏览器打不开网页的解决方案!

    你还在为苹果自带的safari浏览器打不开网页而苦恼吗,接下来的答案会帮助你解决苦恼. 苹果自带safari浏览器的设备分为两种:移动端.PC端.因此不同设备出现safari浏览器打不开网页的情况需要 ...

  9. 百度视频在Android和iOS端性能测试方法

    背景介绍 一直以来,性能测试是被一部分人遗忘,又让另一部分人无可奈何的东西.在绝大部分的创业公司,性能测试基本上都是被遗忘的,他们认为功能测试和稳定性测试才是重点,而在中等规模的公司中一部分测试人员考 ...

最新文章

  1. 深圳大学计算机暑期学校,The First Day-深度学习暑期学校
  2. 启示—地点IT高管20在职场心脏经(读书笔记6)
  3. java服务端项目开发规范
  4. SSM框架项目的pom导入包和xml配置
  5. 使用data attributes
  6. win_server_2012离线安装.net3.5教程
  7. 深入浅出 Cocoa 之 Core Data(3)- 使用绑定
  8. Allwinner(全志)V5 SPI Flash Support List
  9. ideaIU-2018.3.5版本安装
  10. html 多选框取值,多选框取值
  11. linux进入终端tty3,Linux中终端界面与图形界面之间的切换关系
  12. 【无标题】外汇符合挖坟啊喝咖啡卡机
  13. 简单理解什么叫联邦学习(全)
  14. 思科无线POC测试要包含哪些测试项
  15. 华为RH2288H V3服务器raid配置
  16. win7记事本如何转换html,Win7打开记事本显示乱码是为什么?怎么才能正常?
  17. SAP 小币种金额的转换函数和处理
  18. 惠普计算机使用方法,惠普笔记本电脑功能键(HP/联想等笔记本键盘fn键使用说明大全)...
  19. CentOS安装netstat,ifconfig命令
  20. arcgis制作兴趣点分布图

热门文章

  1. 从繁到简so easy,象形柱图尽显数据可视化直观、炫酷本色
  2. html边框自动变颜色,CSS设置边框颜色 css布局边框颜色
  3. (转)DVD转换RMVB格式的方法
  4. 安装EA后win10提示系统资源不足,无法完成请求服务的解决方法
  5. Window Server2012 安装ASPupload记录
  6. 个人表现怎么写学生_小学生家长寄语大全 家长寄语怎么写
  7. 数学文化(四)三角形内角和
  8. 国货美妆需要“诗和远方”
  9. java技术知识简介
  10. 大数据之spark详解