14 replies [Last post]
blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

OK, I made a style BB code for my forum:

Spoiler:

Show Spoiler

$1

($1 is the post variable).

Now, I have a few question:

1. How do I limit the border so it only surround the text, and not the whole post, view here: http://doghousegifts.net/Upload/showthread.php?tid=2&pid=6#pid6

2. Is there a way so that once the spoiler is open, the button remains, and when you press it again, the spoiler closes?

Thanks,

BP

Tags:
thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Could you post the

Could you post the associated CSS for the spoiler? Is there any?

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

Well, this should probably

Well, this should probably be off topic. Its all contained in that HTML snippet. But everytime I use

I just think its CSS for some reason.

The above is the whole code

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Well where exactly are you

Well where exactly are you even specifying that it should have a border?

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

IN the site I gave you the

IN the site I gave you the border surrounds the entire bottom edge of the post. I just want it aroun the text

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

What I mean is, where is it

What I mean is, where is it getting the border from?

Nowhere in that code do I see anything to give it a border?

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

<small>   

Spoiler:

Show Spoiler

IS the correct code. The one I gave you above was the one I released to the community, sorry.

BP

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

You don't have enough ending

You don't have enough ending </div> tags.

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

Thanks

Thanks for that, feel a little stupid

2. Is there a way so that once the spoiler is open, the button remains, and when you press it again, the spoiler closes?

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Do you really need that many

Do you really need that many divs? Personally I'd use something like this:

Spoiler:

Show Spoiler
spoiler zomg

As for the show/hide it can be done but I'm not proficient enough in JS to help there, maybe someone else can use the hooks in my code to whip up a quick button?

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

Well, I am an awkward coder

Well, I am an awkward coder in things like this.....

I'll try yours out and get back to you Laughing out loud

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

My code makes more sense

My code makes more sense than numerous divs with inline styling.

You could either use getelementbyID to target the spoilers if there is more than one on a page, or use getelementbytagname and loop through them.

Which is why I said a JS guru would be better help, I don't know what I'm on about Tongue

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

Weird things

Weird things happened.....check the forum

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 2 weeks 2 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Like I said, now you need a

Like I said, now you need a JS guru to fix the JS Wink

Verschwindende wrote:
  • CSS doesn't make pies

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 29 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

<small>   

Spoiler:

Show Spoiler
$1

This works well. Thanks for all your help guys