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

    Join Date
    Mar 2000
    Location
    Cape Town, South Africa
    Posts
    18
    Rep Power
    0
    One more question...

    Is it possible to do onMouseOvers with images that have been added to the page using PHP?

    I have an arrow image pointing either up or down, depending on whether the query is asc or desc. This image is displayed on the page using a simple if statement, and is within a <a href>, so it's clickable. I've given the image a name attribute of "state". I've got both the 'on' and the 'off' images, but now I can't figure out how to display the 'on' image if the mouse goes over the link and the 'off' image if the mouse is off the image. I've done onMouseOvers before, but maybe this one's just making me go blank or something.

    I'd appreciate any help at all. Thanks

    Warren
    http://amphetamine.tsx.org/
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    Ok let's say you've named your on and off images in the head as such:

    <head>
    <script language="JavaScript">

    if (document.images) {

    var image_up = new Image(111,20)
    image_up.src = "image.gif"

    var home_over = new Image(111,20)
    image_over.src = "image_over.gif"
    }
    </script>
    </head>

    Then in your body, you would set the image label as such:

    <body>
    <a href="page.html" onMouseOver="di('image', 'image_over'); " onMouseOut="di('image','image_up');"><img name="image" src="image.gif" width=76 height=34 alt="" border=0></a>
    </body>

    Hope that helps.

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

    Join Date
    Mar 2000
    Location
    Cape Town, South Africa
    Posts
    18
    Rep Power
    0
    Thanks for the help - I'll check if it works

    Warren

Similar Threads

  1. PHP scripts to run in Javascript continuously
    By linhardt in forum JavaScript Development
    Replies: 0
    Last Post: February 13th, 2004, 02:51 PM
  2. javascript inside php tags
    By andy123 in forum JavaScript Development
    Replies: 5
    Last Post: February 5th, 2004, 04:34 PM
  3. Javascript in PHP
    By tintintin in forum JavaScript Development
    Replies: 5
    Last Post: January 28th, 2004, 05:40 AM
  4. php, mysql, and a tiny bit of javascript programmer for hire
    By benthekiller in forum JavaScript Development
    Replies: 0
    Last Post: January 21st, 2004, 01:15 PM
  5. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 03:12 PM

IMN logo majestic logo threadwatch logo seochat tools logo