怎么写一个文件分享网页?首先一个基本的网页包含主要的哪些就不说了,下面直接上关键的代码即可,把他放到需要的地方即可。下面一起来看看吧。
百度一键分享按钮HTML代码
下面是需要加分享按钮的css代码
另外是需要放在页面的js代码
window._bd_share_config={
"common":{
"bdPopTitle":"您的自定义pop窗口标题",
"bdSnsKey":{},
"bdText":"此处填写自定义的分享内容",
"bdMini":"2",
"bdMiniList":false,
"bdPic":"http://localhost/centlight/public/attachment/201410/24/14/5449ef39574f5_282x220.jpg", /* 此处填写要分享图片地址 */
"bdStyle":"0",
"bdSize":"16"
},
"share":{}
};
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)
];