Welcome to Creative Nation!

Welcome to Creative Nation, . Feel free to browse our forums and help yourself to all our free tutorials, images, and recources!

Download

To download this script go back to article »

Member Login

Lost your password?

Not a member yet? Sign Up!

Cookies


The next generation of web design.


You are not connected. Please login or register

Cookies

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Cookies on 3/17/2011, 3:21 pm

Saxaca

avatar

I've tried for months now, but I still cannot connect a cookie to this script.
I just cannot manage it. With or without plugins >.>

So, anyone got a tip to share?

Here's the script. A category toggler for PunBB. (It only works on my forum due to templates Tongue)
Code:
<script>
jQuery(function() {
jQuery('.main-head').prepend('<span style="float: right; font-size: 2.5em; font-weight: bold; margin-right: 5px; cursor: pointer;" class="catetoggle">-</span>');

jQuery('.catetoggle').click(function() {

if(jQuery(this).parent().parent().find('.main-content').is(':visible')){
jQuery(this).parent().parent().find('.main-content').hide('slow');
jQuery(this).text('+');
}
else{
jQuery(this).parent().parent().find('.main-content').show('slow');
jQuery(this).text('-');
}
});
});
</script>

2 Re: Cookies on 3/19/2011, 8:30 pm

Gangstar15

avatar

Lol.. for some weeks i posted the same in forumotion staff section, so i also need to know this ;D

3 Re: Cookies on 3/20/2011, 6:08 pm

Saxaca

avatar

I figured it ouut!
Well.. not for my toggler, but still Big Grin

Ok..
Forumotion, has, in its http://illiweb.com/rsc/13/frm/lang/en.js file, built in the my_setcookie() and my_getcookie functions!

Now for the syntax Big Grin

Code:
jQuery(function() { // Document, ready
jQuery('.forabg').click(function() { // When clicked..
jQuery('.forabg').hide('slow'); // Hide when it is clicked
my_setcookie('sticky', hidden); // Set cookie name and state
});

var x = my_getcookie('sticky'); // Get cookie name's state
if (x=='hidden') { // When X (sticky) is set to hidden ..
jQuery('.forabg').hide();
}
});

Hmm.. Now finding how to remove them.. dang.. where'd my forabg go? Big Grin

Edit:
Clearing:
Code:
<script>
jQuery(function() {
jQuery('sticky', null);
});
</script>

4 Re: Cookies on 3/21/2011, 6:51 am

Gangstar15

avatar

You saw dion's post in webarts forum Wink

5 Re: Cookies on 3/21/2011, 11:07 am

Saxaca

avatar

I did, but I figured out the syntax myself Big Grin
This may be locked, hidden or whatever your solved topic stuff is Tongue

6 Re: Cookies on 3/21/2011, 11:17 am

Ronin

avatar

~Locked

Congrats for figuring it out, though.



Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

.

Free forum | © PunBB | Free forum support | Contact | Report an abuse | Forumotion.com.