![](/img/trans.png)
[英]Twitter & Facebook Custom Share Buttons With Dynamic URL & Title
[英]Share the link , title and one image in custom twitter share icon
這是自定義twitter圖標代碼:
HTML:
<i id="twitter_share" class="fa fa-twitter fs20" style="position: relative; bottom: 4px;"></i>
和Jquery:
$('#twitter_share').click(function (e) {
e.preventDefault();
var loc = "<?= base_url(uri_string()); ?>";
var title = "<?= $video->title; ?>";
window.open('http://twitter.com/share?url=' + loc + '&text=' + title + '&', 'twitterwindow', 'height=450, width=550, top=' + ($(window).height() / 2 - 225) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
});
它與url和title一起工作正常。 問題是,我如何分享一個圖像?
非常感謝您的幫助。
更新:facebook中的Facebook參考我可以分享這樣的內容,也可以在Twitter上完成嗎? 謝謝。 !
圖像來自您的HTML標記,當有人發布您的網址時,該標記會被Twitter抓取。
Twitter是指將推文作為卡片附帶的元信息集合,他們需要在它出現在網絡上之前批准。
我搜索了一點解決方案,一個解決方案是使用Twitter卡
也許這個帖子會幫助你推特 - 分享按鈕,但有圖像
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.