How can i preload my images?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • billkirim
    New Member
    • Nov 2006
    • 25

    How can i preload my images?

    Hi Guys..
    I am building a site and i not very good at javascript..
    i 've got drop down divs and i want to have the images which are included on them preloaded so the visitor show them fast when he clicks on the menu..

    any help?

    Sorry for my english.. I am from Greece
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    Code:
    <SCRIPT language="JavaScript">
    <!--
    var YourPicture = new Image(); 
    var YourPicture.src="[url="http://somewebsite.com/mypicture.jpg"]http://somewebsite.com/mypicture.jpg[/url]"; 
    //-->
    </SCRIPT>
    HTH,
    Aric

    Comment

    • billkirim
      New Member
      • Nov 2006
      • 25

      #3
      Originally posted by AricC
      Code:
      <SCRIPT language="JavaScript">
      <!--
      var YourPicture = new Image(); 
      var YourPicture.src="[url="http://somewebsite.com/mypicture.jpg"]http://somewebsite.com/mypicture.jpg[/url]"; 
      //-->
      </SCRIPT>
      HTH,
      Aric
      Thanks You ARic i will try it..
      And in my <img src="..." > ?
      Do i have to make any changes there?

      Comment

      Working...