My Little Help Desk - ASP Help Forum
My Little Help Desk - ASP Help Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
 All Forums
 My Little Help Desk - ASP Help
 Active Server Pages
 ThickBox OnClick Event
 New Topic  Reply to Topic
Author Topic  


66 Posts

Posted - 12/27/2007 :  10:09:25  Show Profile  Reply with Quote
Another Tip from alorentz:
Rather than use the thickbox class and use the href location to populate the overlay with AJAX, there will certainly be a time when you do not want to show the href content in the overlay (like Javascript is disabled, and you still need the href to work, and so search engines don't pick up the AJAX purpose pages). So, you need to use onclick event of the link tag, and create a customized function in the thickbox.js file.

<a href="" onclick="dotb('Title For ThickBox', 'someotherurl.asp?width=700&height=500');return false;" title="Some Title">Click me</a>

So, you create a javascript function called dotb(title, url) and reference jquery library to open the overlay.

function dotb(title, url)
$(document).ready(function(){ tb_show(title, url, null); });

When the link is clicked, this will effectively open the overlay with the URL you pass and title you pass into the dotb(title, url) function, regardless of the actual href URL in the link and absence of "thickbox" class.

Good luck!

Keywords: thickbox, onclick, onload, jquery, href, click event
 New Topic  Reply to Topic
Jump To:
My Little Help Desk - ASP Help Forum © Go To Top Of Page
Snitz Forums 2000