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 3 of 3

Thread: javascript warp

  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    nyc
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry javascript warp

    HELP!
    I want to put that trendy jscript warp feature on my page. I want to use it in a way that allows different text to be linked to different display areas.

    It is for a real estate site that i am working on and i will have multiple listings in a table setting, with people able to pass their cursor over the words bathroom, kitchen, living room etc and see an image appear next to the listing - with each listing in the table having the same kind of function.
    the script i have now keep displaying all my links in one location - HOW TO I TELL THE LINKS FOR ONE LISTING TO DISPLAY IN THE FIELD NEXT TO THAT LISTING?
    Here is the code - any help would be MOST appreciated.
    cheers,
    john

    SCRIPT FOLLOWS>>>>>>>>>>

    THIS IS IN THE HEAD

    <script>

    function changeimage(towhat,url){
    if (document.images){
    document.images.targetimage.src=towhat.src
    gotolink=url
    }
    }
    function warp(){
    window.location=gotolink
    }

    </script>
    <script language="JavaScript1.1">
    var myimages=new Array()
    var gotolink="#"

    function preloadimages(){
    for (i=0;i<preloadimages.arguments.length;i++){
    myimages[i]=new Image()
    myimages[i].src=preloadimages.arguments[i]
    }
    }

    preloadimages("images/20091kit.jpg","images/20091lr.jpg","images/20091bath.jpg","images/20091out.jpg","images/20048bath.jpg","images/20048out.jpg","images/20085kit.jpg","images/20085garden.jpg")
    </script>

    THIS IS IN THE BODY WHERE I WANT THE IMAGES TO APPEAR WHEN "WARP" is ACTIVATED

    <a "javascript:warp()"><img src="images/20048bath.jpg" name="targetimage1" border=0></a>

    THIS IS HOW I LINK TEXT TO IMAGES

    <a onMouseOver="changeimage(myimages[0])">Kichen</a></font></b></td>

  • #2
    Have1abanana
    Guest
    Dont quote me on this as I'm not an expert, but how about specifying a new js script for each image/link.
    As in a new script specifying the image name and the url, etc.
    You'll end up with as many scripts as you have images.
    Does this work?




  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    canda
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jose -better than u since 1986
    http://???.com
    Ask And u will receive


  •  

    Posting Permissions

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