Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] image in div query


  • From: hakan at backbase.com (Hakan M.)
  • Subject: [Javascript] image in div query
  • Date: Fri Dec 12 08:53:58 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@xxxxxxxxxx
>> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> .
>