0

我想知道是否可以为 Google 朋友群设置多个登录按钮...

google.friendconnect.renderSignInButton({id:"google-login",style:'long'})

该代码呈现登录按钮。不幸的是,它接受一个 id,并且 id 必须是唯一的。

有没有办法做类似的事情

google.friendconnect.renderSignInButton({class:"google-login",style:'long'})

这将使所有带有 class="google-login" 的 div 呈现为登录按钮?甚至只是渲染两个单独的登录按钮:

google.friendconnect.renderSignInButton({id:"google-login1",style:'long'})
google.friendconnect.renderSignInButton({id:"google-login2",style:'long'})

有人知道解决方案吗?

4

1 回答 1

1

是的,有可能。请记住,将 id 传递给renderSignInButton您时,并没有设置新的按钮 id,而是应该放置这个新按钮的容器的 id。我还注意到在同一个容器中不能有两个登录按钮(至少在不手动克隆的情况下)。

我找到了这个演示页面并使用 Firebug 的控制台运行以下命令

google.friendconnect.renderSignInButton({id: 'memberstate', style: 'long'});
google.friendconnect.renderSignInButton({id: 'colorPicker', style: 'standard'});
google.friendconnect.renderSignInButton({id: 'profile', style: 'text'});

如您所见,这将创建三个登录按钮,每个按钮都有不同的样式

于 2009-08-12T11:29:37.620 回答