xiaodao
01-09-2007, 09:01 AM
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
<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
<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
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
<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
<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