News:

Wondering if this will always be free?  See why free is better.

Main Menu

Spoiler-BBCode in same line

Started by ResizeR, May 15, 2012, 12:26:45 PM

Previous topic - Next topic

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:
Text text text [Spoiler]Spoilerteeext[/spoiler]

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.

All Colours Sam

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.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

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.
* emanuele is in picky mode. :P

Using a span if you "spoiler" a table you will get invalid xhtml.
style="display:inline"
should do the same...I hope...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

All Colours Sam

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.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

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 :)

MrPhil

If the desire is to have the spoiler "anchor" be in-line text and graphics in a <span>, rather than a <div>, perhaps it could be done with a link <a> that pops up a new floating window? You might look at various "fancy tool tip" and "lightbox" PHP codes. I think both of them generate Javascript, so at least part of the action is taking place on the browser. They may just use "onClick" rather than <a>.

A very simple minded system could probably be done with a Javascript function per spoiler (or a unique identifier to a shared function), onClick trigger in a <span>, and the function just puts up an alert box with your spoiler text. You'd probably accumulate the functions (or one function with text for all spoilers) to stick at the end of the output page.

Advertisement: