Results 1 to 4 of 4

Thread: Adding Cookies to a Jquery delayed POPup

  1. #1
    Join Date
    Sep 2015
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding Cookies to a Jquery delayed POPup

    I am a novice web-designer who can usually pull apart a website to figure out how it works, but I have been researching for 2 days now and I feel I need to ask for some help regarding setting up cookies.

    What I am looking to do it have a Delayed popup appear on my page, but I would like it to appear only once every 15 minutes. I have worked out the delayed popup and have a sample here http://2-jobsearch.com/sample

    I just need to know how to merge the cookie code into my current popup code..

    Here is what I have now..

    Code:
    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>sample</title>
    
        <!-- Force latest IE, Google Chrome Frame for IE -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
       
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
        <!-- Bootstrap styles -->
        <link rel="stylesheet" href=" bootstrap.min.css">
    
        <!-- jQuery -->
        <script src="https://code.jquery.com/jquery-1.8.2.min.js">  
        </script>
    
       <script src="js.cookie.js"></script>
        <!-- jQuery Popup Overlay -->
        <script src="jquery.popupoverlay.js"></script>
    
        <!-- Custom styles for the demo page -->
        <style>
        pre.prettyprint {
            padding: 9px 14px;
        }
        .fulltable {
            max-width: 100%;
            overflow: auto;
        }
        .container {
            padding-left: 0;
            padding-right: 0;
        }
        .lineheight {
            line-height: 3em;
        }
        
            color: #fff;
        }
        .page-header {
            border-bottom: none;
        }
        .initialism {
            font-weight: bold;
            letter-spacing: 1px;
            font-size: 12px;
        }
    
        .initialism1 {        font-weight: bold;
            letter-spacing: 1px;
            font-size: 12px;
    }
        </style>
    </head>
    <body>
    
    <!-- Set defaults -->
    <script>
    $(document).ready(function () {
        $.fn.popup.defaults.pagecontainer = '.container'
    });
    </script>
    
    <!-- Fade & scale -->
    
    <div id="fadeandscale" class="well">
         
    <pre class="prettyprint"> This is the POPUP window </pre>
     
    <button class="fadeandscale_close btn btn-default">Close</button></div>
    
    <script>
    setTimeout(function(){  
    $('#fadeandscale').popup({
    opacity: 0.5,
    autoopen: true,
    transition: 'all 3.3s'
    });
    },5000);
    </script>
     
    </body>
    </html>

    I would appreciate any help or thoughts on a solutions or if this question has been asked and solved, please let me know as I could not find the answer.

    Thanks Scott
    Last edited by Beverleyh; 09-13-2015 at 12:51 AM. Reason: Formatting

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I just need to know how to merge the cookie code into my current popup code.
    Where is your cookie code? I can see a jquery cookie plugin but no code to create or read the cookie.

    If you're not sure how to use the jquery cookie plugin, start by searching tutorials - "jquery cookie plugin tutorial" brings up plenty of examples.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Sep 2015
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Beverleyh View Post
    Where is your cookie code? I can see a jquery cookie plugin but no code to create or read the cookie.

    If you're not sure how to use the jquery cookie plugin, start by searching tutorials - "jquery cookie plugin tutorial" brings up plenty of examples.
    Hello beverleyh

    Thank you for your response.

    I had thought that since I could not figure out how to merge the Jquery cookie code with my Jquery popup code , I would post what I had working correctly and add any suggestions to that code.

    Believe me, I have either been searching the wrong tutorials or it's so simple that I can't see the forest through the trees.

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I could not figure out how to merge the Jquery cookie code with my Jquery popup code
    So do you have code for writing, getting and reading a cookie using that plugin? Start by posting that, and if you're still not sure how to integrate it with your popup, somebody can attempt to help you then.

    You need to at least give us something to work with. Having followed X tutorial for using the cookie plugin, please also post a link to that tutorial so that we can follow what you're doing.

    You see, the problem in posting for help with a jquery plugin in this forum, is that you're relying on and assuming that we have knowledge of that plugin too. Other members here (of the helpful responders) *may* have used the cookie plugin before, but if they haven't, you're essentially relying on the goodwill of somebody else to research/learn about the plugin, how to use it, to write the code and apply it on your behalf, and that's unrealistic. Give us something to work with (i.e. Working examples and documentation) and the likelihood of help increases, although it's more likely that you'll get help from the developers of the plugin or the jquery community.
    Last edited by Beverleyh; 09-13-2015 at 03:08 PM. Reason: rewording - better grammar
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. Help with Cookies Jquery Toolbar
    By mulaus in forum JavaScript
    Replies: 6
    Last Post: 03-21-2013, 11:29 AM
  2. Replies: 0
    Last Post: 04-28-2011, 01:30 PM
  3. Delayed loading
    By susaninphoenix in forum HTML
    Replies: 0
    Last Post: 03-22-2009, 12:57 PM
  4. Resolved jQuery Cookies plugin
    By Snookerman in forum JavaScript
    Replies: 3
    Last Post: 12-26-2008, 03:01 PM
  5. Adding a popup function to dropdown menu
    By akulion in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 12-04-2006, 07:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •