PHP/HTML Body Code:
<?php
$shareLink = 'https://www.google.com/maps/';
$linkSocial= '<a class="popup_twitter" href="https://twitter.com/share?url='.$shareLink .'">TWITTER</a>';
echo $linkSocial;
?>
JavaScript/jQuery Code:
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.popup_twitter').click(function(event) {
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
url = this.href,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(url, 'twitter', opts);
return false;
});
});
</script>
0 comments:
Post a Comment