SpecialOne
Registered Member
- Jan 12, 2011
- 65
- 21
I got this free lander from LeadPages, but can not make these social buttons to work. I think I should change something at url parameter. Could someone help?
Code:
jQuery(function($){
$(".share-button").click(function(event){
event.preventDefault();
var service = $(this).data('service');
switch(service) {
case 'facebook':
url = ( LeadPageData['facebookurl']['value'] ? LeadPageData['facebookurl']['value'] : document.URL);
window_size = "width=585,height=368";
go = 'http://www.facebook.com/sharer/sharer.php?u=' + url;
break;
case 'twitter':
url = ( LeadPageData['twitterurl']['value'] ? LeadPageData['twitterurl']['value'] : document.URL);
window_size = "width=585,height=261";
go = 'http://www.twitter.com/intent/tweet?url=' + url;
break;
case 'google':
url = ( LeadPageData['googleurl']['value'] ? LeadPageData['googleurl']['value'] : document.URL);
window_size = "width=517,height=511";
go = 'http://plus.google.com/share?url=' + url;
break;
default:
return false;
}
window.open(go, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,' + window_size);
});
});
Code:
<a href="http://domain-name.com" id="section-content-sharing-facebook" data-service="facebook" class="share-button"><img src="img/facebook.gif"></a>
<a href="http://domain-name.com" id="section-content-sharing-twitter" data-service="twitter" class="share-button"><img src="img/twitter.gif"></a>
<a href="http://domain-name.com" id="section-content-sharing-google" data-service="google" class="share-button"><img src="img/google.gif"></a>