您好,我正在使用bootstrap modalpopup在pageload上显示我的广告。但是,我只希望modalpopup在会话期间只显示一次,并且在用户关闭modalpopup后不再出现。 我尝试过以下代码但是modalpopup在页面刷新后不断出现: < script type =text / javascript> $(window).load (function(){ $('#myModal')。modal('show'); }); < /脚本> 此代码显示每次页面刷新时的modalpopup。知道怎么让它只在会话中出现一次吗? 非常感谢任何帮助!
Hello , i am using bootstrap modalpopup to show my advertisement on pageload. However, i only want the modalpopup to be shown only once during the session and will not appear anymore after the user close the modalpopup. I have tried the following codes but the modalpopup keeps appearing after page refresh : <script type="text/javascript"> $(window).load(function () { $('#myModal').modal('show'); }); </script> This codes shows the modalpopup everytime the page refresh. Any idea how to make it appear only once within a session only? Any help would be greatly appreciated!
推荐答案(窗口).load(function(){ (window).load(function () {
('#myModal')。modal('show'); }); < / script> 此代码显示每次页面刷新时的modalpopup。知道怎么让它只在会话中出现一次吗? 非常感谢任何帮助! ('#myModal').modal('show'); }); </script> This codes shows the modalpopup everytime the page refresh. Any idea how to make it appear only once within a session only? Any help would be greatly appreciated!
你可以使用这个: < script type =text / javascriptsrc =code.jquery/jquery-1.9.1.js>< / script> < script type =text / javascript> you can use this: <script type="text/javascript" src="code.jquery/jquery-1.9.1.js"></script> <script type="text/javascript">
更多推荐
页面加载时Bootstrap Modalpopup
发布评论