www.webdeveloper.com
Results 1 to 5 of 5

Thread: load image before onmouseover

  1. #1
    Join Date
    Nov 2010
    Posts
    66

    load image before onmouseover

    I don't remember how to do this and I cant seem to find it on google (think it was a simple line of code in the header).

    What is the trick to load an image even tho its not on the page? This way if I have an image that will appear with onmouseover it will appear instantly as opposed to having to load the first time?

  2. #2
    Join Date
    Mar 2011
    Posts
    1,109
    This is typically done with some JavaScript in the <head> section of the document, as in:
    Code:
    <script type="text/javascript">
    
     var myImage = new Image;
     myImage.src = '/path/to/image.jpg';
    
    </script>
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Aug 2012
    Posts
    1
    not sure what you asking. Could you be more specific? Thanks!!

  4. #4
    Join Date
    Sep 2006
    Location
    new york
    Posts
    254

  5. #5
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,198

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles