View Full Version : Can i add a comment next to the image in....

05-04-2006, 07:09 AM
hi guys,

i have some javascript on my site:- Farting Fish (http://www.fartingfish.com/random.php)

When i click on a thumbnail it loads a larger version of the image in a popup window. I notice that there is a space to the right of the images in the pop up window.

My aim is to get an Image Description in that space

Is this possible?

Thanks in advance


Davide Zanotti
05-04-2006, 09:57 AM
Yes, you can, but first you should create a reference to the popup window, for example: var newWin = window.open(...);
Then you can create new element (divs,textnode...) and append them to newWin:

var messageContainer = document.createElement('div');
var msg = document.createTextNode('your comment');

messageContainer appendChild(msg);

I haven't tried the code but I think it should work

05-04-2006, 10:53 AM
If you want to put it on the right of smth, use a SPAN, not a DIV

Davide Zanotti
05-04-2006, 11:55 AM
If you want to put it on the right of smth, use a SPAN, not a DIV

span or div, with a bit of css he can put the comment everywhere he wants :)

05-04-2006, 12:19 PM
thanks for the replies guys

Would it be possible for you to explain your answer a little bit clearer, i.e. what your code does and where i put it?

Bearing in mind i dont know javascript, as im sure you can see from thr source code of the gallery, the javascript was a downloaded script, so i dont know really how it works..