Forum Moderators: open
I'm looking for Thickbox [jquery.com] like script. It's great script that allows to show pictures in big popup-like windows. However it doesn't work with links, created with Javascript (with innerHTML).
Do you guys know any similar scripts?
I got round it by manually adding tb_show to the onclick handler of each link I created using Javascript, so something like (using Jquery):
$('#editimages img').each(function()
{
$(this).click(function()
{
tb_show("Replace Image","admin/pictures/replace.php?imgsrc="+this.src+"&imgwidth="+this.width+"&imgheight="+this.height+"&width=500&height=500&KeepThis=true&TB_iframe=true&");
imageClick(this);
});
}
You might be able to find a way to just call tb_init() whenever you create a new link but I remember this didn't seem to work for me.
Good luck anyway, understand the problem is half of the solution ;)
[edited by: authortitle at 9:10 pm (utc) on Sep. 19, 2007]
tb_init('a.thickbox, area.thickbox, input.thickbox');
whenever you create a new link shouldn't work.
if it causes two thickboxes to open on existing links (it shouldn't i don't think?) i'll have a look in thickbox.js and see if that can be changed
I'm not really good at Javasript (I've learnt it just few weeks ago), but I'd really like to make Thickbox work.
I've tried to call tb_init after I use innerHTML, but it still doesn't work:
tb_init('a.thickbox, area.thickbox, input.thickbox');
Instead of thickbox, browser just loads the photo as if it was just simple link to the image. :(
It would be really great if you could tell me how to modify thickbox.