模态弹出在打开后保持消失。 (如何找到有冲突的脚本?)

时间:2017-03-10 13:52:04

标签: jquery html twitter-bootstrap-3 content-management-system bootstrap-modal

我正在尝试在英雄图像上的CTA上实现引导模式。它有点工作,它弹出,但然后立即消失。

我知道这可能是因为我有两个版本的同一个库运行BUT,因为它是CMS我不知道如何定位这些脚本或编辑它们因为我' m害怕我可能会崩溃整个血腥的事情。

它只是一个简单的Bootstrap模式。



//THESE ARE ALL THE SCRIPTS RUNNING ON THE PAGE

<head id="Head1">
<meta charset="utf-8" /><link rel="icon" href="/costar.ico?v=2" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript"><script type="text/javascript" src="http://www.dtc-v6t.com/js/45363.js">
  
</script>
<noscript><img src="http://www.dtc-v6t.com/45363.png" style="display:none;" /></noscript>
</script><script type="text/javascript">$( document ).ready(function() {
    $("ul.nav li:nth-child(5)").text("Market Your Space");
});
</script><meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/Telerik.Web.UI.WebResource.axd?d=R_u6bpYKrV_wf3yBwIyPzlvxi8v-72YlfkC9vnieL_7HEsHSRUO_Bkhy5iF20mzVFFRNI2kS-9WuklIISZfKKGH6aLFpcG5bN_q8tlKIBUxWd9LaMjguwIEvJ016T4rGSLUc3g2&amp;t=636160552680000000&amp;compress=0&amp;_TSM_CombinedScripts_=%3b%3bTelerik.Sitefinity.Resources%2c+Version%3d8.2.5900.0%2c+Culture%3dneutral%2c+PublicKeyToken%3db28c218413bdf563%3aen-GB%3a6a9f3ba9-0b01-4890-9b6c-b4a98b0257b5%3a83fa35c7%3a7a90d6a" type="text/css" rel="stylesheet" />


<!--CUSTOM SCRIPT TO ADD BUTTON-->
<script>
$(function() {
    var html = '<button id="watchVideoBtn" data-target="#myModal" data-toggle="modal" data-toggle="modal" data-backdrop="true" data-keyboard="true">Watch video</button>';

$(".heroimage-calltoaction").replaceWith(html)
});




$(function() {
    $("ul.nav li:nth-child(5)").text("Market Your Space");
});
$(function() {
    $("ul.nav li#productLink").insertAfter($("ul.nav li:nth-child(4)"));
});
</script>
<!--CUSTOM SCRIPT TO ADD BUTTON-->


<link href="/Sitefinity/Public/ResponsiveDesign/layout_transformations.css?unique_key=6362c0c5-018f-4bc2-8741-ca2add2e1e5a" type="text/css" rel="stylesheet" />
<link href="/Sitefinity/WebsiteTemplates/CoStarUK/App_Themes/CoStarUK/global/Reset.css?v=635495676080000000" type="text/css" rel="stylesheet" />
<link href="/Sitefinity/WebsiteTemplates/CoStarUK/App_Themes/CoStarUK/global/Layout.css?v=635495676080000000" type="text/css" rel="stylesheet" />
<link href="/Sitefinity/WebsiteTemplates/CoStarUK/App_Themes/CoStarUK/global/video-js.css?v=635495676080000000" type="text/css" rel="stylesheet" />
<link href="/Sitefinity/WebsiteTemplates/CoStarUK/App_Themes/CoStarUK/global/costaruk.css?v=635495676080000000" type="text/css" rel="stylesheet" />

	<script type="text/javascript" src="/Scripts/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/Scripts/costar.js"></script>
	<script type="text/javascript" src="/Scripts/demoModal.js"></script>
	<script type="text/javascript" src="/Scripts/video-js/video.js"></script>
	<script>
		videojs.options.flash.swf = "/Scripts/video-js/video-js.swf"
    </script>
</body>
</html>
&#13;
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
&#13;
&#13;
&#13;

感谢提前xox的任何帮助

1 个答案:

答案 0 :(得分:0)

检查页面上的小部件(或相应的页面模板) - 那里可能有一个或多个Javascript小部件。 在Sitefinity中,javascript小部件会自动添加标记,但内容编辑者通常也会添加标记,从而导致在页面上呈现双脚本标记。

因此,您需要确保页面上的所有javascript小部件都没有脚本标记。