页面加载时Bootstrap Modalpopup

编程入门 行业动态 更新时间:2024-10-10 15:28:52
本文介绍了页面加载时Bootstrap Modalpopup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我正在使用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

本文发布于:2023-11-24 23:37:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627371.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   页面   Modalpopup   Bootstrap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!