Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript “Fade to black” effect

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #37281
    GMB
    Participant

    I’ve hit a bit of a snag in creating a “fade to black” effect. What I’ve come up with works in JSFiddle, which you can see here:

    http://jsfiddle.net/2ee2r/

    But not on the following test page viewed in Safari and Chrome (haven’t tested it in other browsers):




    Title





    Any idea what I’ve done wrong?

    Thanks in advance for any help.

    #99657
    GMB
    Participant

    Thanks for the suggestion, karlpcrowley, but I get the same results: no problem in JSFiddle; no go in browser.

    Also, I suppose you meant that I should use:

     


    in the otherwise empty div?

    #99660
    GMB
    Participant

    I wasn’t working with a live page, just one on my desktop. I did put the page up at:

    http://mindmadebooks.com/new_test.html

    and got the same results.

    Thanks for your help.

    #99661
    Senff
    Participant

    I think there may be something wrong with the semi-colon at the end of your script, or an invisible weirdo character that comes after it (perhaps if you copy/pasted it from somewhere). Your code didn’t work for me either, but when I delete that whole line and then type it again manually, it works fine.

    });
    #99663
    GMB
    Participant

    Thanks, Senff — there was indeed a space after the final semi-colon. I removed and that did the trick.

    And thanks, karlpcrowley — I should have verified the code.

    I appreciate the speedy replies!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.