socail media share
piaoling 2013-04-17 13:31:28
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class='social-media'>
<a title="send to Facebook" class='social'
data="http://www.facebook.com/sharer.php?s=100&p[title]=test share&p[summary]=This is test shares&p[url]=http://www.baidu.com&p[images][0]=http://www.baidu.com/img/shouye_b5486898c692066bd2cbaeda86d74448.gif"
target="_blank">Facebook Share</a>
<div class='fb-like'>
<fb:like href="http://houhuiliang.gotoip2.com" send="false" layout="button_count" width="45" show_faces="true"></fb:like>
</div>
<a class='social twitter'
data="http://twitter.com/share?text=this is text&url=http://www.baidu.com&via=twitter&related=this is related" title="Share on Twitter" rel="nofollow" target="_blank">
share to twitter
</a>
<script>
(function($){
$('document').ready(function (){
$('.social').click(openSocial);
function openSocial(e){
var url = $(this).attr('data');
console.log(url);
myWindow = window.open(url, '', 'width=800,height=400');
myWindow.focus();
if(e && e.preventDefault) {
e.preventDefault();
} else {
window.event.returnValue = false;
}
return false;
}
})
})(jQuery)
</script>
</div>
发表评论(评论将通过邮件发给作者):