SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Pre Load Images

  1. #1
    Alt+F4= User Control ;-) rabmurdy's Avatar
    Join Date
    Mar 2002
    Location
    Ecosse
    Posts
    398
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pre Load Images

    I haven't got round to learning code other than html, so have to ask what code to use for pre-loading images for a roll over effect.
    I have 6 buttons to change when the mouse is over the image, is it java script and is it hard to implement?

    (I know absolutely 0 about java script, so please be kind)
    "If something is too hard,give it up. The moral my boy is too never try anything"
    "Just because I don't care doesn't mean I don't understand"

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <html>
    <head>
    <script language="javascript">
    
      myImageName = new Image()
      myImageName.src="images/image.gif"
    
      function over(){document.images.myImageName.src="images/image.gif"};
    
      function out() {document.images.myImageName.src="images/image.gif"};
    
    </script>
    </head>
    <body>
    <a href="#" onmouseover="over()" onmouseout="out()">
    <img src="images/image.gif" name="myImageName" 
    alt="enter alt text here" border="0"></a>
    </body>
    </html>
    Heres a simple preload and rollover script using javascript functions (full code shown). There are a few ways to do it, Im sure this will be followed up with others. Shout if you need any help with it.

    Glen

  3. #3
    Alt+F4= User Control ;-) rabmurdy's Avatar
    Join Date
    Mar 2002
    Location
    Ecosse
    Posts
    398
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Glen U are a gentleman, I shall put it to good use.

    Cheers
    "If something is too hard,give it up. The moral my boy is too never try anything"
    "Just because I don't care doesn't mean I don't understand"

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use the src+'_o.gif' style rather than a fixed string in the function - that way you have freedom to use it on more than one image.

    Just a thought Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    Non-Member Forlorn's Avatar
    Join Date
    Mar 2002
    Location
    San Diego, California
    Posts
    1,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Dreamweaver you can do it. Just select the Behaviors Tab...Change settings for IE 5 and then click down on that menu.

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea but then you need this update for netscape

    http://www.macromedia.com/support/dr...netscape_6.htm

  7. #7
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And have you seen the reams of code Dreamweaver produces for that sort of thing?

    Actually I havent checked what changes (if any) MM have made to the behaviours in the new release of MX.

    *runs of to check*


  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from what i saw on my brothers computer(mine wont install), it seems really good. I had a look at some of the code and you can easily add to the library they have

  9. #9
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Andrew - you'd think they'd know not to set me off on one about Dreamweaver ... wouldn't you...

    * looks over his shoulder for Bill *

    he he


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  10. #10
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe, I'm not a big dreamweaver fan, but i dont intend on using it without changing every single bit of code

  11. #11
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope - completely not for me.
    I've always got to know exactly what's going on!

    Hence i use vi solely.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •