Re: [jQuery] Creating a visible link to show and unhide content.

2007-03-14 Thread [-Stash-]
Seems I was wrong, and that the hide function actually does decide if something is block or inline, my bad. Thanks for this David, works a treat. I took a look at Sean's solution as well and that worked too, but this works out a little simpler now that it actually does do what I wanted in the fi

Re: [jQuery] Creating a visible link to show and unhide content.

2007-03-14 Thread Sean O
Luke, To get around the DIV/SPAN issue, try adding/removing classes. Try this: $(document).ready(function () { $('.spoiler').addClass('hide'); $('.show').toggle(function() { $(this).html('(hide me)').next('.spoiler').removeClass('hide'); },function(){

Re: [jQuery] Creating a visible link to show and unhide content.

2007-03-14 Thread David Duymelinck
[-Stash-] schreef: > $(document).ready(function () { > $('span.spoiler').hide(); > $('span.show').click(function() { > $(this).next('span.spoiler').slideToggle('fast'); > }); > }); > > i think you look for something like this $(function(){ // create link and hide spoile

[jQuery] Creating a visible link to show and unhide content.

2007-03-14 Thread [-Stash-]
I'm currently trying to create a spoiler hiding addon for a forum using jQuery. I basically want to have all Ps, DIVs and SPANs with a class of .spoiler inside of #Comments .CommentBody to autohide the text and provide a clickable "Spoiler: click to show" that, when clicked, shows the hidden text