ioncube at 08h28
18
Sep
2011
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':
then I simply wrote this to make browser remember users click event choice (via cookie):
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');
then I simply wrote this to make browser remember users click event choice (via cookie):
- 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
1 ioncube, on 19/09/2011 at 20h41
anyone sir; I need it please
2 kirk, on 19/09/2011 at 21h26
i dont even understand what it's supposed to do?
or what it has to do with any cookies.
what are you trying to make or get out of it.
it looks simple you can see where you add content to the sliding box, then the other content, what ever it's for?
or what it has to do with any cookies.
what are you trying to make or get out of it.
it looks simple you can see where you add content to the sliding box, then the other content, what ever it's for?
- Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Welcome box</title>
<style>
#sliderBox{
width:200px;
height:150px;
background-color:silver;
position:absolute;
top:-400px;
left:-400px;
z-index:300;
}
#mask{
position: absolute;
z-index: 200;
top: 0px;
left: 0px;
width: 100%;
opacity: .4;
filter: alpha(opacity=40);
background-color: #333333;
}
</style>
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="scriptbreaker-slideto-1.0.js"></script>
<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>
</head>
<body>
</head>
<body>
<div id="mask" ></div>
<div id="sliderBox">
<center>
<input type="button" id="closeWelcomeBox" value="Don't show again"/><br /><br />
JQuery Welcome box. Uses the scriptbreaker slideTo function.<br />
</center>
</div>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
Content goes here
</body>
</html>
3 ioncube, on 19/09/2011 at 22h06
Am sorry if i can't explain. Let me giv example of profile position toggler. If you toggle position towards either right or left browser remembers your choice. That is you refresh page & profile position remains unaltered.
Now with my page. I am designing a welcome popup!! When a user click 'Don't shoe it again' it must NOT appear after even refreshing page. But this isn't happening at present. Visit my page again ...
Now with my page. I am designing a welcome popup!! When a user click 'Don't shoe it again' it must NOT appear after even refreshing page. But this isn't happening at present. Visit my page again ...
4 kirk, on 19/09/2011 at 22h59
oh??
it might depend on the browser as well,
Not sure i would have to play around with it to see.
It may be there is just something you can ad to the cookies part of the code, but what that would be??? not sure at this point.
it might depend on the browser as well,
Not sure i would have to play around with it to see.
It may be there is just something you can ad to the cookies part of the code, but what that would be??? not sure at this point.
5 ioncube, on 19/09/2011 at 23h27
you always proved a great help to me; can you refer it to someone who can help...will much appreciate
Got this cleared
I have to add this .js file:
https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js
or else this command be useless:
Got this cleared
I have to add this .js file:
https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js
or else this command be useless:
- Code:
$.cookie('hidewelcome', 'collapsed');
6 ankillien, on 20/09/2011 at 03h43
Have you added the cookie plugin?
lol..it was already solved
Topic Solved
7 ankillien, on 20/09/2011 at 03h46
ioncube wrote: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:
- 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');
then I simply wrote this to make browser remember users click event choice (via cookie):
- 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![]()
Similar topics
Hi,
My plan was to make a div fixed to the top when you recieve a PM, instead of showing a pop up. But when I did that, the bar was only visible the first time a page got loaded, ie. when you clicked a link on the page, will the bar be hidden
I want to do an effect where I'm able to have the cookie cutter on a slant and be able to keyframe and function it as I would be able to with a normal circle cookie cutter.
Here is an example of what I mean::
@0:10 -
just treid to put some jquery code to Homepage Message
Code:<script>$('.classname').after('new text');</script>
after submiting and reloading Homepage Message I observed problem with $ sign:
$ sign is changed
Replies 1 to 7 on 7 for "Jquery Cookie Problem"
Search
Informations
7 Replies For the topic :
"Jquery Cookie Problem"
This topic has been viewed 686 times.
Last message :
18/09/2011 at 08h28 by "ioncube"





