One-time FancyBox popup like on Digg.com

China☆狼群 提交于 2019-12-04 21:04:16

My eventual solution uses the Reveal Modal plugin (click here) to trigger inline to 'fire' on page load using the modified following code for the popup to be displayed only once every three days. Remember also to load jquery.cookie.js and then add the following code:

<script type="text/javascript">
jQuery(document).ready(function(){
   if (jQuery.cookie('test_status') != '1') {
     jQuery('#myModal').reveal()
        jQuery('#myModal').trigger('click');
        jQuery.cookie('test_status', '1', { expires: 3}); }
   });
</script>

Using something other than FancyBox was the answer to the original question as it seemed there was a conflict somewhere, so using Reveal made the two functions completely separate. I should also note that the .css contents from the Reveal download were added to our site's stylesheet.

Hopefully that will help someone else out.

JFK

You can find a code example here https://stackoverflow.com/a/8305703/1055987 including the link to the jQuery Cookie plugin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!