SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cross-Browser Image Swap code

    Hi everyone:

    Ever since I first used NS6, it has been buggy as hell when dealing with JavaScript image swaps/mouseovers. - The Images seem to dissapear for a second and then re-appear - something to do with NS6 having another DOM I think.

    Even the V4.01 'patch' for DW4 from Macromedia doesn't seem to work for me.

    Does anyone know of any rock-solid JavaScript MouseOver code, that'll work at least on IE5+ and NS6+ ??

    Cheers folks.

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never had any problems with the DW4 image swap scripts and Netscape 6 ..... and I don't have any patch either -- it just works!


  3. #3
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Greg - cheers for your reply.

    Well if DW's JavaScript Image Swap code is robust enough, I must be implementing it incorrectly.

    So in the head of my HTML document (no DOCTYPE):

    <script language='javascript' type='text/javascript'>
    <!--
    function MM_preloadImages() //v3.0 - rest of function here
    function MM_swapImgRestore() //v3.0 - rest of function here
    function MM_findObj(n, d) //v4.0 - rest of function here
    function function MM_swapImage() //v3.0 - rest of function here
    //-->
    </script>

    The functions are called thus - for each image:
    <a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('a','','images/bn_home_on.gif',1)"><img src="images/bn_home_off.gif" width="175" height="21" name="a" border="0" alt="Home."></a>

    What can I be doing wrong? It works fine in IE? (doesn;t everything?)

    By the way - how do you manage to get the honour of "SitePoint Drunk"? - is this the next 'plateu' above "SitePoint Enthusiast"?? ;-)

    Cheers

  4. #4
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's no different to mine. And I don't see how it could be ....

    Are you sure your rollover script isn't getting screwed up by/conflicting with another script? I had an incident once that took me ages to figure out where a script I was using to scroll layers was getting screwed up *BY* a part of DWs image swap scripts. That's all I can think it might be.



    SitePoint drunk simply involves lots of this ...

    G

    Ps -- Just tried it in Netscape 6 to make sure I'm not cracking up, and it works fine!

  5. #5
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK Cheers mate - although I'm no JavaScript guru so I have no idea which functions DW needs and doesn't of the four on there. I assume it does need 'em or it wouldn't put them in automatically.

    Could be a NS6 version issue - I'm on 6.2.3


    By the way that has to be the best animated gif i've ever seen ;-)


    Take it easy.

  6. #6
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm no guru either, but DW seems pretty good for not leaving redundant scripts lying around.

    As for Netscape, I have an earlier release than you -- it could have changed I guess .... ? I'm on 6.0.1!


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
  •