Supreme Directory – Splash page that shows only 1 time, checked by JS cookie

This topic contains 12 replies, has 2 voices, and was last updated by  Atilla Boz 6 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #384658

    Atilla Boz
    Full Member
    Post count: 280

    Hello guys,

    I have a question about saving Javascript Cookies. I made this test page: http://werbederbe.de/musterseite

    There you can see a splash page (like a popup) and that popup thing only shows up one time. When you click the X it fades away and you see the page. At the same time a cookie is being in the browser.

    So the browser can check if the popup / splash page did show up before or not. If the user has the cookie in his browser then the popup will not show up again.

    Now here`s my problem: I get it to work on my test area from the link at the top – but when I try to set it up at my GD page under boz1.timmeserver.de I cant get it to work properly. I can click the X, the splash page / popup disappears but when I enter the URL in the browser again it shows up and seems not to save the cookie – or maybe its saved but the checking fails – i dont know.

    I can put the JS code in lots of different places but it never works for some reason…

    Usually I add to lines in the HTML head like this:

    
    
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js"></script>

    But then I saw jQuery also works without the first line, too – so I deleted that one and just left the other one to import the cookie stuff.

    Normally I wanna make this code here work:

    
    
    <script>
    /* Add Cookie to check if the splash page has been visited  */
    $(document).ready(function() {
        if ($.cookie('noShowSplash')) $('#splash').hide();
        else {
            $("#close-splash").click(function() {
                $("#splash").fadeOut(1000);
                $.cookie('noShowSplash', true);    
            });
        }
    });
    </script>

    and this is the div area that i use + some extra CSS:

    
    
    <div id="splash">
    <input type="checkbox" name="hide" id="hide">
    <label class="hide" for="hide" id="close-splash">X</label>
    <div class="overlay2">
        <div class="overlay">
            <div class="overlay-inner">
                <div class="message">
                    <h3>Header</h3> 
    
                    <p>Text</p>
                    <!--
                    <input type="checkbox" name="hide" id="hide">
                    <label class="hide" for="hide" id="close-splash">Weiter zur Seite</label>
                    --> 
                </div>
            </div>
        </div>
    </div>
    </div> <!-- End splash -->

    I tried just adding the JS script before the popup / splash DIV, I tried after it, I tried in the HTML head, I tried it at GD – Design – Scripts (tried both in header script and header footer area) now I dont know what else to do so I hope maybe you can help me out with a hint.

    Kind regards,
    Atilla

    #384659

    Atilla Boz
    Full Member
    Post count: 280
    This reply has been marked as private.
    #384660

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #384719

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #384951

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #384977

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385022

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385023

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385037

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385087

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385088

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385114

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #385229

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket