Results 1 to 4 of 4

Thread: How To Apply an "effect" a certain number of times?

  1. #1
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How To Apply an "effect" a certain number of times?

    I am relatively new to using DHTML and I found these scripts very useful

    I do have one question.

    Currently I am working with this script

    http://www.dynamicdrive.com/dynamicindex3/document7.htm

    Now this question isn't specific to this effect but I'll use it as an example

    When you enter the page it gives you a cool boxing in effect. However, I wanted to use it on a page that has thumbnails. So obviously whenever you click the thumbnail, look at the larger jpg, then go back, you get the boxing in effect again.

    Again this can get annoying.

    Now I found other scripts here that have cool effect, but I don't want to use them too often.

    I tried to write a cookie for this above effect, and it did work, it let me apply it three times for the session, but does anyone have any idea how to do something GENERIC. (First of all my cookie skills aren't great)

    I guess I am looking for a "cookie" or another way to do this so I can apply it to all effects or easily modify it to any effect here, so that my visitors will only see the, say boxing in effect, maybe the first three times they click on the page, then it goes away for, say a day.

    Any ideas, or is this gonna get way too complicated?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Try:
    Code:
    function doit(){
    if(document.referrer.indexOf(window.location.host) != -1) return;
    window.scrollTo(0,0)
    This disables the effect if the user isn't coming from another page on your site. Not quite what you asked for, but it should serve, generally speaking.

    Other than that, I'm afraid it's back to cookies
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks I tried it but I can't get it to work

    Shame, 'cause it's a cool effect, it just is gonna drive people nuts

    There's got to be a simpler way to write a cookie.

    Hmmm

    LOL

  4. #4
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok after running hit and miss with my homemade cookie I ran across this effect

    http://www.dynamicdrive.com/dynamici...stickynote.htm

    This sticky note effect seems to be able to be applied radomly or once per session.

    I was working at adapting the code in it for the "box in" effect.

    Not very experienced here.

    You think that would work?
    Hmmm

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
  •