Thickbox Cookie Question (SOLVED)
Moderator: General Moderators
Thickbox Cookie Question (SOLVED)
Any idea on how to trigger a thick box once a page is loaded? But also set a cookie so it happens once?
Last edited by cupaball on Wed Jan 28, 2009 11:01 am, edited 2 times in total.
Re: Thickbox Question
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.
There is also some Javascript out there that allows you to access cookies. Google it too.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Thickbox Question
Uh...okay.
Can someone point me in the right direction?
Can someone point me in the right direction?
Re: Thickbox Question
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Thickbox Question
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".
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>