Page 1 of 1

Thickbox Cookie Question (SOLVED)

Posted: Mon Jan 19, 2009 7:23 pm
by cupaball
Any idea on how to trigger a thick box once a page is loaded? But also set a cookie so it happens once?

Re: Thickbox Question

Posted: Tue Jan 20, 2009 5:27 pm
by pickle
There are tons of different Thickbox scripts out there - most with pretty good documentation on how to invoke them. Google it.
There is also some Javascript out there that allows you to access cookies. Google it too.

Re: Thickbox Question

Posted: Wed Jan 21, 2009 12:31 pm
by cupaball
Uh...okay.

Can someone point me in the right direction?

Re: Thickbox Question

Posted: Wed Jan 21, 2009 1:41 pm
by pickle

Re: Thickbox Question

Posted: Wed Jan 28, 2009 11:00 am
by cupaball
Thanks for all the help...

For those of you looking for the code, here it is. Make sure you have you the jquery, thickbox, and jquery cookie code referenced in your code and this will do it..

This code will show a thickbox once by setting a cookie for 6 days. You can change "thickbox-page-cookie", "iwashere", "expires: 6" and "http://www.google.com?keepThis=true&TB_ ... &width=900".

Code: Select all

 
<script type="text/javascript">
 
$(function() {
    var COOKIE_NAME = 'thickbox-page-cookie';
    $go = $.cookie(COOKIE_NAME);
    if ($go == null) {
        $.cookie(COOKIE_NAME, 'iwashere', { path: '/', expires: 6 });
        tb_show('', 'http://www.google.com?keepThis=true&TB_iframe=true&height=373&width=900', null);
    }
    else {
    }
});
 
</script>