Warning: Creating default object from empty value in /home/cf9819/public_html/shibumi.net/wp-content/themes/dkret3/header.php on line 17

Thickbox Activation on Button Click

I’ve been doing quite a bit of WordPress hacking for a couple somewhat involved projects as of late. It took a little fumbling around to figure out how to get Thickbox to activate on a button click vs. the usual link click. The js code is below. Simply wrap it in a function and call it using the onclick event of the button:

tb_show('Thickbox title here', '#TB_inline?height=300&width=305&inlineId=CHANGE-ME-INPUT-ID-OF-BUTTON&modal=false', null);

Thanks to http://www.juxtaflo.com/chad/thickbox-rollover-activation for the tip off.

Leave a Comment

Your email is never published nor shared.

(required)
(required)