[Javascript] image in div query
Hakan M.
hakan at backbase.com
Fri Dec 12 08:53:53 CST 2003
Err, move the getElementById('placeholder') inside the if(_oImage)-clause.
I'm at work here, ok? ;)
Hakan M. wrote:
> This should work, in theory. The "placeholder" div is where your image
> will appear. No warranties, not tested.
>
>
> <div id="placeholder"></div>
>
> <img onmouseup="showfull('image.jpg')" src="thumb_image.jpg" />
>
>
> <script type="text/javascript">
>
> var _oImage = null;
> function showfull(sImage) {
> oDiv = document.getElementById('placeholder');
> if(_oImage) {
> _oImage = document.createElement('IMG');
> oDiv.appendChild(_oImage);
> }
> _oImage.src = sImage;
> }
>
> </script>
>
>
>
> Alan Easton wrote:
>
>> Hello people,
>>
>> I have a query. I was looking to do the following. I have a list of
>> thumbnail images, about 20 or so. What I would like is that when you
>> mouse
>> over each thumbnail, or click on each thumbnail, the bigger image of the
>> thumbnail appears in a div or somehow on the same page, just below or
>> somewhere beside all the thumbnails.
>>
>> Now I know how to pop them into a new browser window, but I would like
>> the
>> bigger image to appear on the same page, in a div tag or something.
>>
>> Does anyone know how easy this is or how it can be done.
>>
>> Any help would be appreciated,
>>
>> Thanks,
>>
>> Alan...
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
> .
>
More information about the Javascript
mailing list