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

Thread: image effect

  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts

    image effect

    Hi

    i am doing a website for a school, you can see a half done page here
    http://www.yanmin.net/mac/science.php

    on the middle rightside there is a bluebox ,inside there got three thumbnail, i want to mouse over the thumbnail and showing a bigger picture

    i use this javascript ( also provided by cf member) put inside the head
    Code:
    	<script type="text/javascript">
    function display_picture(pic_url, pic_x, pic_y){
    	var pic_win = document.getElementById("pic_win")
    	pic_win.innerHTML = "<div style='vertical-align:middle; height:100%;'><img align='middle' src='"+pic_url+"'></div>"
    	pic_win.style.left = pic_x + "px"
    	pic_win.style.top = pic_y + "px"
    	pic_win.style.display = "block"
    }
    function hide_pic(){
    	var pic_win = document.getElementById("pic_win")
    	pic_win.style.display = "none"
    }
    </script>
    then i added this line
    Code:
    <div id="pic_win" style="position:absolute; display:none; width:200px; height:200px;"></div>
    but it just wont work, you can view my souce code to see.... thanks for your help
    flying dagger

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    I tested the code you provided and I could not find a problem with it.

    The error must be elsewhere on your page.
    I would rather be a lion for a day than a lamb that lives forever.

  • #3
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It looks like it works to me on your webpage too. The one problem is it is drawing it at coords 0, 0. So if you don't have a big enough monitor you can't see it being drawn up there.

    david_kw

  • #4
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts
    any chance i can shift the image showing around the mouse?
    flying dagger


  •  

    Posting Permissions

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