Tuesday, 15 June 2010

html - Bootstrap social share button -



html - Bootstrap social share button -

i'm trying add together social share buttons on blog bootstrap, i'm not getting how set url site after link of twitter /share.

this code:

<a href="https://twitter.com/share" class="btn btn-social btn-twitter"> <i class="fa fa-twitter"></i> share on twitter</i> </a>

---------- edited: it's half working. i've made function open popup, link-in-popup:

<a href="http://www.facebook.com/sharer.php?u=" class="btn btn-social btn-facebook link-in-popup"> <i class="fa fa-facebook"></i> share on facebook</i> </a>

but open link "https://www.facebook.com/sharer/sharer.php?u", how url of page after "u"? twitter opens popup link, not facebook. need " <a href="http://www.facebook.com/sharer.php?u=[urlpage]"

twitter has section on website documents how various buttons function. available @ https://about.twitter.com/resources/buttons.

assuming have twitter's sharing script element included on page, link tweet button custom url need introduce data-url attribute on a element:

<a href="https://twitter.com/share" class="..." data-url="http://example.com"> <i class="fa fa-twitter"></i> share on twitter</i> </a>

if don't have script element included on page suggest generate button through page i've linked above , modify after copying html generates there you.

html css social-networking

No comments:

Post a Comment