Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with JavaScript Kit OnMouseover Whipper 2.0

    Hi All,

    I'm creating my website with flash-based Moonfruit. When trying to insert an HTML snippet for Mouseover effect, I was recommended using the JavaScript Kit OnMouseover Whipper 2.0 (http://www.javascriptkit.com/mousewhipper/index.htm), which worked great. However, the snippet seems to clashing with the image link on the Moonfruit editor, and now it's not clickable anymore...

    I can't seem to find any solution and Moonfruit can't debug a third-party code.

    I'm not a web developer and knows very little about code...but is there a way to insert an href to this code (for a flash-based site)?

    this is the mousewipper code i've inserted:

    <script language="javascript1.1">
    <!--

    /*Code generated by the onMouseover whipper
    Visit http://javascriptkit.com for more info*/

    a9=new Image(160,160)
    a9.src="http://oferke.moonfruit.com/communities/5/004/010/672/145/images/4584757756_160x160.jpg"
    a878=new Image(160,160)
    a878.src="http://oferke.moonfruit.com/communities/5/004/010/672/145/images/4584758097_160x160.jpg"
    //-->
    </script>
    <script>
    <!--
    function filter(imagename,objectsrc){
    if (document.images)
    document.images[imagename].src=eval(objectsrc+".src")
    }
    //-->
    </script>
    <a href="yoururl.htm"
    onmouseover="filter('a874','a878')"
    onmouseout="filter('a874','a9')">
    <img src="http://oferke.moonfruit.com/communities/5/004/010/672/145/images/4584757756_160x160.jpg" name="a874" border=0 width=160 height=160></a>

    Please HELP!!!!!!

    Thank you
    Mey

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    That javascriptkit script is ANCIENT!!! (as they all seem to be). I would first find, or create, a better script.

    Please wrap your code in [CODE ] [/ CODE] tags (without the spaces).
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with JavaScript Kit OnMouseover

    Thank you AndrewGSW. I realize this is an antique code....but I'm not a web developer and I don't know how to write a better script. That's why I posted my request on JavaScript programming's forum...for your help.

    Please help me.

    Mey.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Short and simple:
    Code:
    <img
    src="http://oferke.moonfruit.com/communities/5/004/010/672/145/images/4584757756_160x160.jpg" 
    style="border: none; width: 160px; height: 160px;"
    onmouseover="this.src=this.src.replace('458475775','458475809');"
    onmouseout="this.src=this.src.replace('458475809','458475775');"
    />
    <img
    src="http://oferke.moonfruit.com/communities/5/004/010/672/145/images/4584758097_160x160.jpg" 
    style="visibility: hidden; width: 1px; height: 1px;"/>
    We could be more subtle, but why? The "trick" here is to cause the preloading of the alternate image. But we don't want that alternate image to actually show. So we shrink it to a 1 pixel by 1 pixel image and then, on top of that, hide the pixel. Yet it will still get loaded by the browser at the same time the main image is loaded. And so, when we do the onmouseover, it will instantly appear.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,133
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    And, yes, you can still wrap the main <img> tag in your <a>...</a> tags.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

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