I hav done quite a homework in determining the code to be precise the 'cookie code' such that the browser remember my choice!
Vistt this : https://defencedog.googlecode.com/svn/welcomebox/jquery_welcome_box.html
by viewing the source you will determine the two jquery (essential files) that are needed & I ain't tempering with them.
However I had tried to customise this passage:
First I created a cookie when the button is clicked & giv it its respective property namely 'collapse':
This isn't working or am I missing something
Vistt this : https://defencedog.googlecode.com/svn/welcomebox/jquery_welcome_box.html
by viewing the source you will determine the two jquery (essential files) that are needed & I ain't tempering with them.
However I had tried to customise this passage:
- Code:
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#sliderBox').slideTo({
transition:300,
top:'center',
left:'center',
inside:window
});
$('#mask').height($(document).height());
jQuery(window).resize(function() {
$('#sliderBox').stop().slideTo({
transition:300,
top:'center',
left:'center',
inside:window
});
});
var closeWelcomeBox;
$(window).scroll(function(){
if(!closeWelcomeBox){
$('#sliderBox').stop().slideTo({
transition:300,
top:'center',
left:'center',
inside:window
});
}
});
$("#closeWelcomeBox").click(function(){
$('#sliderBox').stop().slideTo({
transition:500,
top:-400
});
$('#mask').fadeOut(500);
closeWelcomeBox = true;
$.cookie('hidewelcome', 'collapsed');
});
// COOKIES
var hidewelcome = $.cookie('hidewelcome');
if (hidewelcome == 'collapsed') {
$('#sliderBox').css("display","none");
$('#mask').css("display","none");
closeWelcomeBox = true;
};
});
</script>
First I created a cookie when the button is clicked & giv it its respective property namely 'collapse':
- Code:
$.cookie('hidewelcome', 'collapsed');
- Code:
// COOKIES
var hidewelcome = $.cookie('hidewelcome');
if (hidewelcome == 'collapsed') {
$('#sliderBox').css("display","none");
$('#mask').css("display","none");
closeWelcomeBox = true;
};
This isn't working or am I missing something