the popup window will be prompted when loading the page, and then user click the Close button on popup window to close.
now i would like to control the popup window only prompted when user first time visit. for the re-visit, it will not prompt.
but now it is failed to control when the user revisit the page, it still prompt in the below coding.
how can i hide the popup window when user revisit?
<script type="text/javascript">
$(document).ready(function() {
if(document.getElementById("visitCount").value !="1"){
$('#Dialog').show();
}
//setTimeout($.TAF.ui.hideLoadingOverlay, 3000);
});
function ClickClose(){
$("#Dialog").hide();
document.getElementById("visitCount").value="1";
var hiddenFiled=document.getElementById("visitCount").value;
alert(hiddenField);
}
</script>
<style>
.modal {
display: none;
position: fixed;
z-index: 999;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
</style>
<!--testing begin-->
<input type="hidden" id="visitCount" name="visitCount" />
<div id="Dialog" class="modal" tabindex="-1" >
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title"> Testing</h2></div>
<div class="modal-body">
<div id="infoDetail"><p>
<p>Content</p>
</div>
</div>
<div class="modal-footer"><div class="btn-center">
<button id="Close" onClick="ClickClose();" value="Close"/>
</div>
</div>
</div>
</div>
</div>
<!--testing end-->