EDIT:
I've solved it!
Thanks for the help guys.
Page 1 of 1
Any jQuery experts?
#2
Posted 02 January 2010 - 10:47 PM
There's a problem in this line
You've got single quotes inside single quotes which won't work.
If you haven't already, get firefox with firebug and web developers toolbar for testing. It'll show you errors and tell you what's going on.
$('a.toggle[name='+id+']').toggle();
You've got single quotes inside single quotes which won't work.
If you haven't already, get firefox with firebug and web developers toolbar for testing. It'll show you errors and tell you what's going on.
#3
Posted 03 January 2010 - 12:03 AM
It works fine at the moment with the single quotes funnily enough. The code shown there doesn't have any implementation of the cookie plugin. I was hoping someone would be able to steer me in the right direction of the code I'd need to write up to get it working.
#4
Posted 03 January 2010 - 10:51 AM
Have only used the cookie plugin a couple of times but all you need to do add the following line into your toggle function - including a check for the original cookie:
That is from a really good example I found ages ago, but can't find the link. I'll have a look for it.
if ($('a.toggle[name='+id+']').is(":hidden")) {
$("'a.toggle[name='+id+']'").slideDown("slow");
$(this).addClass("active");
$.cookie('showTop', 'collapsed');
return false;
} else {
$('a.toggle[name='+id+']').slideUp("slow");
$(this).removeClass("active");
$.cookie('showTop', 'expanded');
return false;
}
That is from a really good example I found ages ago, but can't find the link. I'll have a look for it.
- ← Fancy Jquery Image Rotator
- CSS, XHTML/HTML & JavaScript
- Help fading background images with jQuery →
Share this topic:
Page 1 of 1
Help
















