Results 1 to 7 of 7

Thread: Sticky Note - Close if click the hide button twice from the website

  1. #1
    Join Date
    Jul 2017
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sticky Note - Close if click the hide button twice from the website

    1) Script Title: Sticky Note script v2.0

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...stickynote.htm

    3) Describe problem:

    Hi! I love the code but I would like to have a functionality in this script of after clicking twice the hide button the sticky note will not appear again in other pages of the website. Any idea please.. thanks in advance.


    Regards,

    Julz

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Try this modified version of the script (allows note to be shown twice per session):

    stickynote.js

    Use 'session' for the showfrequency property.

    The browser cache may have to cleared, the page refreshed, and/or any existing cookie cleared to see changes.

    NOTES: This modification uses the browser cookie already generated by the script. It will not work if cookies are turned off. Also, if testing locally, cookies might not work at all, so be sure to try it on a live page. Any existing cookie from previous tests may interfere with the new code. So, if you've already used the cookie in testing the script, either close the browser session or clear the cookie before testing the new code.
    Last edited by jscheuer1; 07-03-2017 at 08:00 PM. Reason: fix error in original code
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2017
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John. This is great!

    However, what I am looking for is not a browser session. I am looking into the number of clicks it is closed for example I am in the home page and the sticky note appears then hit close (1st click) then after that I go to about us page the sticky note appears then hit closed (2nd click). Then I open again another page for example contact us page or any other page of the website the sticky note will not going to appear anymore. Any idea?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This does that as far as I can tell. Since it can only appear twice per session, by the second click to close it, it will not appear again. The session is a site wide cookie. Most browsers these days save sessions even when they are closed, so this is pretty permanent. We could make it a permanent cookie though. That would mean that the note would never be seen again unless the user clears the cookie or logs in with a different browser.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2017
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay! anyhow the modified version of the script is great.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sorry, didn't mean to end the discussion. I just don't see any difference between what you asked for and what the modified code does. If there is some problem I'd be happy to see if a different or additional modification could be made to address that. But, if so, you will have to make it clearer to me what you're after and how that would differ from the behavior of the current modified script.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2017
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry for not being clear. So far the modified version of the script is good. Thank you your your help.

Similar Threads

  1. Sticky note v2.0 hide automatically after showing manual by clicking link
    By chuckyschl in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 09-17-2013, 01:06 PM
  2. Window Widget hide close button, close with esc
    By twright6 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-03-2012, 03:00 PM
  3. Sticky Tooltip to close on link click
    By laughingstare in forum JavaScript
    Replies: 0
    Last Post: 03-12-2010, 08:27 PM
  4. Sticky note script - Close on Click help
    By userforum in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 09-19-2007, 07:52 AM
  5. Replies: 0
    Last Post: 09-04-2005, 11:57 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
  •