#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    6
    Rep Power
    0

    javascript: advanced hotkey system



    <script language="JavaScript1.2">


    var hotkey=49
    var destination="index.html"
    if (document.layers)
    document.captureEvents(Event.KEYPRESS)
    function backhome(e){
    if (document.layers){
    if (e.which==hotkey)
    window.location=destination
    }
    else if (document.all){
    if (event.keyCode==hotkey)
    window.location=destination
    }
    }
    document.onkeypress=backhome

    </script>


    The above is a script which produces the hotkey, '1'. On click, it will redirect you to a destination, in this case, 'index.html'.

    Edit: I know how to play a song, what I'm looking for... is to play a song, without leaving the page your currently on. For example, when I do this, and the song plays, it takes me to a new page. It's blank, and only shows the music's progression, and status bar. I want to be able to play the music as a background, after hitting my hotkey.
    Last edited by argyle; July 14th, 2003 at 06:02 PM.
  2. #2
  3. Monkey Magic
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    UK
    Posts
    103
    Rep Power
    13
    you could create a hidden iframe and point the direction to that.

    that way you shouldn't leave the page your on, just make sure you set some options on the iframe otherwise Netscape will
    ignore it.

    Kong.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    6
    Rep Power
    0
    Ok. Thanks for the advise.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    6
    Rep Power
    0
    To add on this, does anyone know how to stop all music from playing, with a hotkey.
    Last edited by argyle; July 14th, 2003 at 09:29 PM.

IMN logo majestic logo threadwatch logo seochat tools logo