Results 1 to 3 of 3

Thread: Image Change using mouseover

  1. #1
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image Change using mouseover

    Hi All,

    Please take a look at: http://cgi.ebay.com/vtg-70s-CROCHET-...ht_1870wt_1219

    I have no knowledge of Javascript but am good with HTML and some basic PHP. I am designing a similar eBay page and the customer wants an image change on mouse over similar to the link above. How can I achieve this without having code in the head section of the page as eBay forbids.

    I was hoping someone could point me to an open source script or a free script that I could implement easily enough? I did find one on DD, but it requires head content and calls a script file...

    Anyone?
    Thanks,
    Jeff.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    </head>
    
    <body>
    <img src="http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg"
    onmouseover="this.src='http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg';"
    onmouseout="this.src='http://www.vicsjavascripts.org.uk/StdImages/Egypt5.jpg';"
     />
    </body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The code above should work fine. Generally, you can place anything from the head section into the body section within script tags and it will function similarly. It may not be the "best" way to do it (and it may not always work) but when you can't use the head section, it's a viable work around in many cases. I don't remember if ebay allows <script> tags at all though so that's important to check. But you can get around the head issue in most cases.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •