Customizing SMF > SMF Coding Discussion

Spoiler-BBCode in same line

(1/2) > >>

ResizeR:
Hi,

I want this Quick Spoiler MOD/BBCode to be setted in the same line.

I want to be able to Write text inbefore the spoiler box. Like this:

--- Code: ---Text text text [Spoiler]Spoilerteeext[/spoiler]
--- End code ---

Quick example:
Text text text

I'd tried to figure out, but I couldn't find the place in the source code, where it adds a new line.

Suki:
Hi, welcome to SMF.

It seems that mod uses a div to generate the spoiler content, this means it will always be displayed on a new line unless you do some changes and wrap the previous text in another div and use floats properties, but is a mess to do it like that.

The best you cna do is change the div for a span in Subs-QuickSpoiler.php  and set some css on the span to be treated as an inline display.

Keep in mind that this will not always work, depending on how long the previous text is or how small is the user resolution the spoiler will be displayed on a new line.

emanuele:

--- Quote from: Suki on May 15, 2012, 01:14:19 PM ---The best you cna do is change the div for a span in Subs-QuickSpoiler.php  and set some css on the span to be treated as an inline display.

--- End quote ---
* emanuele is in picky mode. :P
Using a span if you "spoiler" a table you will get invalid xhtml.

--- Code: ---style="display:inline"
--- End code ---
should do the same...I hope...

Suki:
Yes, I don't use span because a spoiler is basically a content wrap and that is precisely what a div do.  There is a lot of things you cannot put inside a span tag.

ResizeR:
I tried to replace the div's with span's additional fixed some stylebugs with CSS and i'm happy with it.  :)
You just made my day!
thanks for helping :)

Navigation

[0] Message Index

[#] Next page

Go to full version