2011-04-14 48 views
0

我試圖創建像Facebook和Twitter的彈出窗口。當您點擊facebook.com以外的另一個網站上的Facebook按鈕時,如果您未登錄,它會打開一個彈出窗口,以便您登錄,然後當您單擊「登錄」時,它會關閉返回身份驗證你點擊按鈕的網站。創建像Facebook或Twitter的iframe

與twitter相同的東西。

有什麼想法?

他們的代碼是這樣的: 這些例子指向我工作的網站。

的Twitter:

<iframe frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?counturl=http://www.cromaz.com&amp;count=horizontal&amp;via=mundocromaz&amp;text=Cromaz,%20rede%20social%20pra%20vizinhos!%20100%25%20brasileira!&amp;url=http://www.cromaz.com&amp;" style="width:105px; height:20px; overflow:hidden; position:relative; left:3px;" /> 

Facebook的:

<iframe src="http://www.facebook.com/plugins/like.php?locale=pt_BR&amp;href=http://www.facebook.com/pages/Cromaz/139676989421131&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21;" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px; position:relative; left:6px;" /> 

回答

1

使用您的解決方案,我加入了一些修改:

對於Twitter的Like按鈕:

<iframe allowtransparency="true" 
src="http://platform.twitter.com/widgets/tweet_button.html?counturl=http://www.divinersystems.com 
     &amp;count=horizontal 
     &amp;text=PIC%20Configuration%20Tool 
     &amp;url=http://www.divinersystems.com" 
_mce_src="http://platform.twitter.com/widgets/tweet_button.html" 
style="border: medium none; overflow: hidden; width: 80px; height: 21px;" 
_mce_style="border: none; overflow: hidden; width: 80px; height: 21px;" frameborder="0" scrolling="no"> 
</iframe> 

對於Facebook的Like按鈕:

</iframe> allowtransparency="true" 
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.divinersystems.com 
     &amp;layout=button_count 
     &amp;show_faces=false 
     &amp;width=400 
     &amp;action=like 
     &amp;font 
     &amp;colorscheme=light 
     &amp;height=21" 
_mce_src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.divinersystems.com 
     &amp;layout=button_count 
     &amp;show_faces=false 
     &amp;width=400 
     &amp;action=like 
     &amp;font 
     &amp;colorscheme=light 
     &amp;height=21" 
style="border: medium none; overflow: hidden; width: 400px; height: 21px;" 
_mce_style="border: none; overflow: hidden; width: 400px; height: 21px;" 
frameborder="0" scrolling="no"> 
</iframe> 

爲您的網站取代:

WWW .divinersystems.com - >您的網站

PIC%20Configuration%20Tool - >文本(%20是空格鍵)

如果您使用Joomla 1.6創建的類型爲「自定義HTML」新的模塊,給它下的「顯示標題」按隱藏你的標題,選擇「菜單分配」,你希望看到它,粘貼你修改的代碼(當你在切換編輯器模式),並保存。

  • 請注意,如果代碼消失進入 - >「內容」 - >「選項」 - >「文本過濾器」 - >選擇您的用戶類型,並更改「過濾器類型」爲「無過濾」。

我希望這會有所幫助!

-1

使用http://fancybox.net/

應該是完美的,你需要什麼。

+0

你知道他不只是在談論「彈出」本身,對吧? – ifaour 2011-04-14 14:15:09

+0

哦,對,誤讀。難道他們都只是爲此實現OAuth? http://developers.facebook.com/docs/authentication/ << facebook實現。 http://oauth.net/ << api home – olan 2011-04-14 14:21:42

+0

是的,但我不認爲他們在用戶點擊「贊」按鈕時「登錄」Facebook時不會使用它。 – ifaour 2011-04-14 14:26:27