Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member I Brian's Avatar
    Join Date
    Oct 2002
    Location
    Yorkshire, UK
    Posts
    149
    Member #
    26861
    Hi there -

    I'm sure there's a simple trick for pre-loading images...and think it involves Javascript. But I can't find the code required. Any ideas?



    :chinese:

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I think it's something along these lines:
    Code:
    img = new Image;
    img.src = "img url";
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member I Brian's Avatar
    Join Date
    Oct 2002
    Location
    Yorkshire, UK
    Posts
    149
    Member #
    26861
    Hmm...I'm not actually sure how to apply that in context.

    Basically, I'm looking to pre-load rollovers.

    If we call the image that rollsover "a.jpg", and the rollover image as "b.jpg", then how would I fit that into the HTML?

    Thanks for this - I've tried to learn as much as possible on own steam. Figure asking now can't harm, though.

  5. #4
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    <script language='javascript'>


    rollimg1 = new Image();
    rollimg1.src = "a.gif";

    rollimg2 = new Image();
    rollimg2.src = "b.gif";


    </script>



    <img name='rollim1' src='a.gif' onmouseover='document.rollim1.src=rollimg1.src' onmouseout='document.rollim1.src=rollimg2.src' border='0'>


    Hope that helps


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com