本文实例讲述了爪哇岛描述语言实现类似百度分享功能的方法。分享给大家供大家参考。具体如下:
像腾讯,开心社区都提供这种分享接口的,做百度分享功能很简单的一般网站要接入分享功能,大部分都用百度分享和添加此的代码,可是自己定制性太差,该分享功能样式都可以自己修改,简洁没过多射流研究…代码,大大提高网页加载速度。
运行效果如下图所示:
!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN ' ' http://www .w3。org/TR/XHTML 1/DTD/XHTML 1-Transitional。DTD ' html xmlns=' http://www .w3。org/1999/XHTML ' hearteta http-equiv=' Content-Type ' Content=' text/html;charset=utf-8' /title网络分享代码分享/titlestyle type='text/css'/** *分享代码样式* by kily */# AK _ share { padd :10 px 0;font-size :12 px}.AK _ share {身高:1%;飞越:隐藏;}.AK _ share dt { float : left font-weight : bold;color : # a5a5 a5 height :16 Px行高:16 px}.AK _ share DD {边距-右:10 px左边距:0;高度height:16pxfloat:left }。AK _ share a :悬停{ color : # ed 7811文本修饰:下划线;}.AK _ share a { float : leftheight :16 px行高:16 px左填充left :18 px background : URL(www . http://。YEM 120。com/images/share。gif)左上方无重复;颜色: # 666文本装饰:无;}.ak_sharet _ 163 _ s {背景-位置: 0-16px;}.ak_sharet _ QQ _ s {背景-位置: 0-32px;}.ak_shareqzone _ s {背景-位置: 0-48px;}.ak共享豆瓣_s {背景-位置: 0-64px;}/style/head dydiv id=' AK _ share ' dl class=' AK _ share ' dt分享:/dt DD a class=' t _ Sina _ s ' href=' JavaScript :(function(){ window。打开(' http://v。新浪科技。com。cn/share/share。PHP?title=' encodeURIComponent(文档。title)' URL=' encodeURIComponent(位置。href)' source=bookmark ',' _blank ',' width=450,height=400 ');})()"title="分享到新浪微博rel='nofollow '新浪微博/a/DD DD a class=' t _ 163 _ s ' href=' JavaScript 3:(function(){ window。打开(' http://t。163 .com/文章/用户/检查登录。做什么?链接=http://新闻。163 .com/source=' info=' encodeURIComponent(文档。标题)' ' encodeURIComponent(位置。href),' _blank ','宽度=510,高度=300 ';})()"title="分享到网易微博rel='nofollow '网易微博/a/DD DD a class=' t _ QQ _ s ' href=' JavaScript :(function(){ window。打开(' http://v。t . QQ。com/share/share。PHP?title=' encodeURIComponent(文档。title)' URL=' encodeURIComponent(位置。href)' source=bookmark ',' _blank ',' width=610,height=350 ');})()"title="分享到腾讯微博rel='nofollow '腾讯微博/a/DD DD a class=' qzone _ s ' href=' JavaScript : void(窗口。打开(' http://SNS。qzone。QQ。com/CGI-bin/qz share/CGI _ qz share _一键?URL=' encodeURIComponent(文档。位置。' href));'标题='分享到即时通信软件空间rel='nofollow'QQ空间/a/DD DD a class=' douban _ s ' href=' JavaScript : void(function(){ var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s 3。创建范围(。)text : ' ',r=' http://www。豆瓣。com/recommend/?URL=' e(d)位置。href)' title=' e(d . title)' sel=' e(s)' v=1 ',x=function(){if(!window.open(r ),豆瓣、“工具栏=0,大小可调整=1,滚动条=是,状态=1,宽度=450,高度=330”)位置。href=r ' r=1 ' };if(/firefox/).测试(导航器。用户代理)){ setTimeout(x,0)} else { x()})()"title="推荐到豆瓣rel='nofollow '豆瓣/a /dd /dl/div/body/html希望本文所述对大家的爪哇岛描述语言程序设计有所帮助。