本文介绍了页面加载时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!

推荐答案




这篇关于页面加载时Bootstrap Modalpopup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 06:51