Jquery 类似于按钮ajax iframe布局从按钮计数恢复为标准
寻找和搜索我几乎不期望得到答复;)因为我不认为有很多人尝试过这个。问题相对较小,我更希望有人也有同样的问题。我们拭目以待Jquery 类似于按钮ajax iframe布局从按钮计数恢复为标准,jquery,facebook,facebook-like,Jquery,Facebook,Facebook Like,寻找和搜索我几乎不期望得到答复;)因为我不认为有很多人尝试过这个。问题相对较小,我更希望有人也有同样的问题。我们拭目以待 //when share is clicked remove all content in share and add in facebook's like button $('#flb').live('click',function(){ var ID = $('#question-shell').attr('data-id'); $( '#flbCon
//when share is clicked remove all content in share and add in facebook's like button
$('#flb').live('click',function(){
var ID = $('#question-shell').attr('data-id');
$( '#flbCont' ).empty().append( $('<iframe />')
.attr( 'src', 'http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.wouldyourather.eu%2F%3Fid%3D'+ ID +'&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light&height=21' )
.attr( 'scrolling', 'no' )
.attr( 'frameborder', 'no' )
.attr( 'style', 'border:none; overflow:hidden; width:450px; height:80px;' )
.attr( 'allowTransparency', 'true' )
);
return false;
});
//单击共享时,删除共享中的所有内容并添加到facebook的like按钮中
$('#flb').live('click',function()){
var-ID=$(“#问题外壳”).attr('data-ID');
$('#flbCont').empty().append($('')
.attr('src','http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.wouldyourather.eu%2F%3Fid%3D“+ID+”&;布局=按钮(计数和显示)面(面)面(假)面(宽)面(假)面(宽)面(宽)面(
.attr('滚动','否')
.attr('frameborder','no')
.attr('style','border:无;溢出:隐藏;宽度:450px;高度:80px;'))
.attr('allowTransparency','true')
);
返回false;
});
这是我的密码。只需删除facebook共享位置持有者中的内容并添加新的动态内容即可。但是当它被jquery时,样式会显示为标准,即使在html中它说它应该加载标准而不是按钮计数版本
任何想法都会是布里尔:)
干杯,伙计们确保你喜欢的url末尾没有去掉“&”。这将导致布局设置不正确,并默认为“标准” 我也遇到了同样的问题,于是取下了放大器;留下了符号和字符,这似乎解决了问题。希望这有帮助-我也找了一会儿。只需将查询字符串中的“href”参数移动为最后一个参数。在代码中,您可以将其更改为
.attr( 'src', 'http://www.facebook.com/plugins/like.php?layout=button_count&show_faces=false&width=100&action=like&colorscheme=light&height=21&href=http%3A%2F%2Fwww.wouldyourather.eu%2F%3Fid%3D'+ ID)
希望这有帮助。最后,我使用了.load(),并将代码放在单独的页面中,然后将其加载。我不知道这个迟来的回复是否还有帮助,但希望其他对此也有困难的人能看到它
我发现如果我改变所有的&;去&然后它成功了 为你的回答干杯伙计。。。很高兴知道有人关心:)好吧,我已经编辑了这样的代码,但仍然没有运气,它仍然默认为标准:($(''flbCont').empty().append($('').attr('src','ID+'和layout=button\u count&;show\u faces=false&;width=100&;action=like&;colorscheme=light&;height=21&'))遗憾的是,以下各项都不起作用,因此我不得不稍微重新设计该功能:(