我在每次您使用“幻灯片自动前进已停止”的控件导航我的幻灯片时都会显示一个警告框,所以我想知道有没有办法像 cookie 或任何东西一样在本地存储信息,以便如果他们按下控件一次并看到消息,如果他们继续导航,它将停止显示。
JS 脚本
<script>
$(document).ready( function() {
$("#pressed1").click( function() {
jConfirm('Slideshow auto advance has stopped!<br />Press OK to stop showing this message for 2 hour.', 'Website alert');
});
});
$(document).ready( function() {
$("#pressed2").click( function() {
jConfirm('Slideshow auto advance has stopped!<br />Press OK to stop showing this message for 2 hour.', 'Website alert');
});
});
$(document).ready( function() {
$("#pressed3").click( function() {
jConfirm('Slideshow auto advance has stopped!<br />Press OK to stop showing this message for 2 hour.', 'Website alert');
});
});
$(document).ready( function() {
$("#pressed4").click( function() {
jConfirm('Slideshow auto advance has stopped!<br />Press OK to stop showing this message for 2 hour.', 'Website alert');
});
});
</script>
HTML 代码
<div id="main2">
<div id="gallery">
<div id="slides">
<div class="slide"><img src="imgs/slide.imgs/1.jpg" onmousedown="return false;" style="border-style: none" width="1040" height="400" alt="side" /></div>
<div class="slide"><img src="imgs/slide.imgs/1.jpg" onmousedown="return false;" style="border-style: none" width="1040" height="400" alt="side" /></div>
<div class="slide"><img src="imgs/slide.imgs/3.gif" onmousedown="return false;" style="border-style: none" width="1040" height="400" alt="side" /></div>
<div class="slide"><a href="buywebdesign.html" onmousedown="return false;" target="_blank"><img src="imgs/slide.imgs/4.gif" style="border-style: none" width="1040" height="400" alt="side" /></a></div>
</div>
<div id="menu">
<ul><div class="thumbs">
<li class="fbar"> </li>
<li class="menuItem"><a href=""><img src="imgs/slide.imgs/thumb_ball.png" id="pressed1" onmousedown="return false;" style="border-style: none" alt="thumbnail" /></a></li>
<li class="menuItem"><a href=""><img src="imgs/slide.imgs/thumb_ball.png" id="pressed2" onmousedown="return false;" style="border-style: none" alt="thumbnail" /></a></li>
<li class="menuItem"><a href=""><img src="imgs/slide.imgs/thumb_ball.png" id="pressed3" onmousedown="return false;" style="border-style: none" alt="thumbnail" /></a></li>
<li class="menuItem"><a href=""><img src="imgs/slide.imgs/thumb_ball.png" id="pressed4" onmousedown="return false;" style="border-style: none" alt="thumbnail" /></a></li>
</div> </ul>
</div>
</div>
</div>