Click to See Complete Forum and Search --> : fairly simple but troubling me...
messenjah
05-22-2003, 12:55 AM
Okay, to most of you this will be no problem, but its like 1am and I can't think clearly. What I want to do is when a user clicks on a thumbnail that picture is displayed on the same page, NOT a page by itself and NOT a pop up. If anyone can help that would be great! Thanks! :D
You can do that with div's :
gad a put her a browser check with something like that :
----------------------
function show(sw,obj)
etc...
----------
style sheet
.myLayersClass { position: relative; visibility: hidden; }
---ad as many div's as you like----
<div id = "div" class = "myLayersClass" align="center">
<br>ANY IMAGE<br>
<img src="ANYIMAGE.JPG" height=189 border=0 alt="" width=287>
</div>
---two buttons ..appears image and hides...---
<div id="div2" align="center">
<form action="" method="post" name="myForm">
<input type=button value="Show Div" onClick="show(true,'div');"> <input type=button value="Hide Div" onClick="show(false,'div');">
</form>
</div>
cheers
Asch
:D
messenjah
05-22-2003, 12:15 PM
Sorry that made NO sense to me, can anyone else put it in simpler terms or help me out in a different way? Thanks!
Try this out:
<script language="javascript" type="text/javascript">
function showPic(img) {
document.getElementById("mydiv").innerHTML='<img src="'+img+'">';
}
</script>
</head>
<body>
<a href="yourimage.png" onclick="showPic(this.href); return false;"><img src="yourthumbnail.png" border="0"></a>
<div id="mydiv"></div>
messenjah
05-22-2003, 01:49 PM
thanks that worked out great!
Charles
05-22-2003, 02:01 PM
Pyro,
Gollum (http://forums.webdeveloper.com/member.php?s=&action=getinfo&userid=6428 has, in a recent posting, brought to our attention the fact that the Element.innerHTML object[?] is non-standard and he or she does appear to be correct. (See http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html).
Vladdy
05-22-2003, 02:04 PM
or if you want to do it right:
function showPic(img,description)
{ bigImg = document.getElementById("mydiv").appendChild(document.createElement('img'));
bigImg.src = img;
bigImg.alt = description;
}
well seems to that my mind is to complicated lol...:o)
asch