Jquery Fancybox(Internet Explorer)中未显示Facebook共享按钮
我正在模式窗口(fancybox)中呈现共享facebook按钮 它在Chrome和Firefox上运行良好,但我无法在IE11上运行 代码看起来完全相同 以下是我所拥有的:Jquery Fancybox(Internet Explorer)中未显示Facebook共享按钮,jquery,asp.net,facebook,fancybox,fancybox-2,Jquery,Asp.net,Facebook,Fancybox,Fancybox 2,我正在模式窗口(fancybox)中呈现共享facebook按钮 它在Chrome和Firefox上运行良好,但我无法在IE11上运行 代码看起来完全相同 以下是我所拥有的: <body> <div id="fb-root"></div> <script> var cultureInfo = '@System.Globalization.CultureInfo.CurrentCulture.Name'; cultureInfo =
<body>
<div id="fb-root"></div>
<script>
var cultureInfo = '@System.Globalization.CultureInfo.CurrentCulture.Name';
cultureInfo = (cultureInfo == "fr" ? "fr_FR" : "en_US");
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/" + cultureInfo + "/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
var cultureInfo='@System.Globalization.cultureInfo.CurrentCulture.Name';
cultureInfo=(cultureInfo=“fr”?“fr\u fr”:“en\u US”);
(功能(d、s、id){
var js,fjs=d.getElementsByTagName[0];
if(d.getElementById(id))返回;
js=d.createElement;js.id=id;
js.src=“//connect.facebook.net/”+cultureInfo+“/all.js#xfml=1”;
fjs.parentNode.insertBefore(js,fjs);
}(文档“脚本”、“facebook jssdk”);
@item.prenom@item.nom@item.ville.nom,@item。ProvinceCulture@Ressources.wordBornIn@item.dob.Year
«@Html.Raw(item.commentaire.ToString().Replace(“\n”,“
”)»
$(文档).ready(函数(){
$(“.fancybox”).fancybox({
beforeShow:函数(){
//将变量设置为下一个div元素
newTitle=$(this.element).next('div')
//用属性克隆它
.clone(真,真)
//更改ID以避免ID重复
.find(“#demo”).attr(“id”,“demo2”).end()
//将目标更改为新ID
.find(“#btnTranslate”).attr(“数据目标”,“演示2”).end()
//显示为html
.html();
//覆盖fancybox标题
this.title=''+newTitle+'';
}
});
});
有线索吗?谢谢
newTitle=$(this.element).next('div')
似乎缺少一个结束分号代码>。。。也许你应该添加.html()
渲染下一个div
Yeah我的复制粘贴错误。原始代码包含分号和.html()。我编辑了这个问题。
<a class="fancybox" rel="group" href="@(item.video == null ? "/Content/Image/Facteur/" + item.photo : item.video)" style="text-decoration: none;">
</a>
<div style="display: none;">
<!-- my title for fancybox above-->
<div class="fb-share-button coeurJumbotron" data-href="@Ressources.webAdress/facteur/FacteurStatic?Id=@item.Id" data-type="button_count" style="width:auto;"></div>
<p class="lead"><h4 style="color:black;"><u><b>@item.prenom @item.nom</b></u></h4><h5 style="color:black;"><b> @item.ville.nom, @item.ProvinceCulture</b></h5><h5 style="color:black;">@Ressources.wordBornIn @item.dob.Year</h5></p>
<p class="lead"><h4 style="color:black;"><b>«</b> @Html.Raw(item.commentaire.ToString().Replace("\n", "<br />")) <b>»</b></h4></p>
</div>
<script>
$(document).ready(function () {
$(".fancybox").fancybox({
beforeShow: function () {
// set variable to next div element
newTitle = $(this.element).next('div')
// clone it with properties
.clone(true, true)
// change ID to avoid ID duplication
.find("#demo").attr("id", "demo2").end()
// change the target to new ID
.find("#btnTranslate").attr("data-target", "#demo2").end()
// show as html
.html();
// override fancybox title
this.title = '<div class="myTitle">' + newTitle + '</div>';
}
});
});
</script>