SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: onMousedown

Hybrid View

  1. #1
    http://TheICE.co.uk/ The Eerie Network's Avatar
    Join Date
    Apr 2001
    Location
    London in the UK.
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onMousedown

    OK, before we start, i'm useless with JavaScript, HTML, PHP, Networks, MySQL i'm all fine with, but JavaScript is just one big pain in the butt to me, so please be gentle.

    OK, here is my question:

    I'm using the fantistic ss:links on my new site as a links page (http://eerie.net/daboyz/links/), and to try and mike the site look cool i'm using:

    Code:
    onMouseover="this.bgColor='#02305A'" onMouseout="this.bgColor='#04417A'"
    to make the background color change in my tables (I found the code on a javascript site somewhere). what I wanted to do now was make it so that if a user click on the table (not link, just the table) it will foward them to the page requested.

    I believe that if I set onMouseover within the <table> tag it should work (fingers crossed) but I don't know how to complete the code.

    I hope this makes sence.

    Thenx Guys and Gals.
    Daniel Hollands
    New: My Webcam <-- Come and watch me doing what I do
    TheICE.co.uk <-- New sites for the best in UK lifestyle and Competitions.
    The ofDan.Network Forums <-- Come and join in the fun.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    onclick="window.location.href='bla.html'"



    Better yet, if you wanted to get tricky, and this was on a <td> cell with only one link, you could merely copy and paste this snippet on all your navigational td cells without modifying the href bit, like you would have to above:

    onclick="window.location.href=this.all?this.all.tags('a')[0].href:this.getElementsByTagName('a')[0].getAttribute('href')"

    Jason - Contact Me
    Supermoderator @ CodingForums

  3. #3
    http://TheICE.co.uk/ The Eerie Network's Avatar
    Join Date
    Apr 2001
    Location
    London in the UK.
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, that works like a star :-)
    I've chosen the first option because as the page is being dynamicly processed I would not have to worry about changing the url, the php script will do that for me. and it looks less complex

    Again, thank you.
    Daniel Hollands
    New: My Webcam <-- Come and watch me doing what I do
    TheICE.co.uk <-- New sites for the best in UK lifestyle and Competitions.
    The ofDan.Network Forums <-- Come and join in the fun.


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
  •