Submit Your Article Modifications Contact Us

Titan Quest


Go Back   Titan Quest Forums > General > Site News & Feedback
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read



If you are having problems logging in, send a mail to webmaster@titanquest.net and we'll try to sort something out.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2009, 05:50 PM
yerkyerk's Avatar
yerkyerk
[User Offline]
 
Join Date: Feb 2008
Posts: 6,115
yerkyerk is on the right path
Default Spoiler button

Added a spoiler button

Answer to Life, the Universe and Everything:
WARNING: This box contains a spoiler
show me


I'm not sure if it works as it should...
__________________
Reply With Quote
  #2 (permalink)  
Old 06-17-2009, 05:57 PM
jiaco's Avatar
jiaco
[User Offline]
Demi God
 
Join Date: Sep 2008
Location: GMT+1
Posts: 891
jiaco is aiming to become a model tq.netter
Default Re: Spoiler button

Quote:
Originally Posted by yerkyerk View Post
Added a spoiler button

Answer to Life, the Universe and Everything:
WARNING: This box contains a spoiler
show me


I'm not sure if it works as it should...
WARNING: This box contains a spoiler
show me


Cool though that it works inside the QUOTE!
Reply With Quote
  #3 (permalink)  
Old 06-17-2009, 06:02 PM
yerkyerk's Avatar
yerkyerk
[User Offline]
 
Join Date: Feb 2008
Posts: 6,115
yerkyerk is on the right path
Default Re: Spoiler button

Lol, yea, it's the other way around. I'm trying to adapt the YouTube one, but I really don't know much HTML anymore..
__________________
Reply With Quote
  #4 (permalink)  
Old 06-17-2009, 06:13 PM
yerkyerk's Avatar
yerkyerk
[User Offline]
 
Join Date: Feb 2008
Posts: 6,115
yerkyerk is on the right path
Default Re: Spoiler button

Currently, I've got this
HTML Code:
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="466">
<tr>
<td class="smallfont">
<strong>IMPORTANT NOTICE:</strong> This contains a spoiler</div></td></tr>

<tr>
<td class="smallfont" align="right">
<a href="#" onclick="return toggle_collapse('{param}')"> Show me the spoiler!</a>
</td></tr><tbody id="collapseobj_{param}" style="display:none;">
<tr>
<td class="alt1" align="center">
</td></tr></tbody>
</table>
Which turns into this; [spoiler2]whatever[/spoiler2]
But I don't know how it should show any text... I think it's something with param, but I don't know..
__________________

Last edited by yerkyerk; 06-17-2009 at 07:02 PM. Reason: updated html code; i left half of it out
Reply With Quote
  #5 (permalink)  
Old 06-17-2009, 06:47 PM
Wyvern's Avatar
Wyvern
[User Offline]
The Official Janitor
Olympian God
 
Join Date: Dec 2006
Location: The Shed of Blood!
Posts: 2,412
Wyvern is on the right path
Thumbs up Re: Spoiler button

Look, even I can make spoilers!

WARNING: This box contains a spoiler
show me


That doesn't work, does it?
__________________
Check out Act V: Boreal Rampage, the finished story now in a Word File! You'll want it!

Yeah, it's an Avatar avatar and has a wyvern-like ikran on it. You got the joke.
Reply With Quote
  #6 (permalink)  
Old 06-17-2009, 07:01 PM
yerkyerk's Avatar
yerkyerk
[User Offline]
 
Join Date: Feb 2008
Posts: 6,115
yerkyerk is on the right path
Default Re: Spoiler button

Well, it allows you to hide spoilers once you've seen them
__________________
Reply With Quote
  #7 (permalink)  
Old 06-17-2009, 07:08 PM
Wyvern's Avatar
Wyvern
[User Offline]
The Official Janitor
Olympian God
 
Join Date: Dec 2006
Location: The Shed of Blood!
Posts: 2,412
Wyvern is on the right path
Default Re: Spoiler button

Then for me it doesn't work properly.

Can't you fix it, Yerk?

In the meantime, I'll have fun using:
[spoiler2]Aysewm!![/spoiler2]

Wait. IT DOESN'T SHOW ANYTHING!

Can you fix both, yerk?
__________________
Check out Act V: Boreal Rampage, the finished story now in a Word File! You'll want it!

Yeah, it's an Avatar avatar and has a wyvern-like ikran on it. You got the joke.
Reply With Quote
  #8 (permalink)  
Old 06-17-2009, 07:24 PM
jiaco's Avatar
jiaco
[User Offline]
Demi God
 
Join Date: Sep 2008
Location: GMT+1
Posts: 891
jiaco is aiming to become a model tq.netter
Default Re: Spoiler button

<input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" />

<div id="show";display: none;margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
<img src="http://www.hardfitness.com/emagazine/issue9/images/DSC_3124.jpg" border="0" alt="" /></div>

Actually this is what the HTML looks like and there is a problem with the div after id="show" there is no style=" before the css code (which actually starts with a semi-colon which should not be there...)

Can you try this:
<div id="show" style="display: none;margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">


I leave the rest of this junk here for now:


If this is your code:

<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="466">
<tr>
<td class="smallfont">
<strong>IMPORTANT NOTICE:</strong> This contains a spoiler</div></td></tr>

<tr>
<td class="smallfont" align="right">
<a href="#" onclick="return toggle_collapse('{param}')"> Show me the spoiler!</a>
</td></tr><tbody id="collapseobj_{param}" style="display:none;">
<tr>
<td class="alt1" align="center">
</td></tr></tbody>
</table>

Then everything between <tbody> ... </tbody> should start off on style="display:none;"

the onclick function should then set the style to "display:block;" in order to show it.

I do it like this

javascript:

function HIDE( id )
{
document.getElementById( id ).style.display = "none";
}
function SHOW( id )
{
if( document.getElementById( id ) ) {
document.getElementById( id ).style.display = "block";
}
}
function TOGGLE( id )
{
if( document.getElementById( id ) ) {
if( document.getElementById( id ).style.display = "block" ) {
HIDE( id );
} else {
SHOW( id );
}
}
}

HTML:
<div id="spoiler" style="display:none;" class="spoilertext" onmousedown="TOGGLE( spoiler );">TEXT TO HIDE</div>

Of course if you can use css then

.spoilertext
{
display:none;
}

removes the need to set the style in the div if you set the class

Its one or the other, both is overkill.

Last edited by jiaco; 06-17-2009 at 07:40 PM.
Reply With Quote
  #9 (permalink)  
Old 06-17-2009, 07:46 PM
bonobo4's Avatar
bonobo4
[User Offline]
Olympian God
 
Join Date: Mar 2009
Location: England
Posts: 1,783
bonobo4 is aiming to become a model tq.netter
Default Re: Spoiler button

" style="display:none;">
WARNING: This box contains a spoiler
')"> show me
I have no idea what's going on
I like this idea, though I can't see the point of it!
__________________
"To conquer fear, you must become fear" - Batman
"To conquer fat, you must become fat" - Reginald D. Hunter

54 Champion | 50 Avenger | 35 Conjurer | 13 Ranger
Hardcore UBER Challenge Humourous Weapons Story Of A God TQ Wiki Religious Discussion Xmax Challenge Xfire TQ

Last edited by bonobo4; 09-11-2009 at 04:01 PM.
Reply With Quote
  #10 (permalink)  
Old 06-17-2009, 10:04 PM
yerkyerk's Avatar
yerkyerk
[User Offline]
 
Join Date: Feb 2008
Posts: 6,115
yerkyerk is on the right path
Default Re: Spoiler button

@jiaco: thanks for helping out, heh even though I couldn't follow what you were typing

I just had to put in {param} somewhere in the commands (as well as copying back some stuff from the youtube thing). Anyway, it should work now:
WARNING: This box contains a spoiler
show me



Current code for spoiler:
Code:
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="466">
<tr>
<td class="smallfont">
<strong>IMPORTANT NOTICE:</strong> This contains a spoiler</div></td></tr>

<tr>
<td class="smallfont" align="right">
<a href="#" onclick="return toggle_collapse('{param}')"> Show me the spoiler!</a>
</td></tr>
<tbody id="collapseobj_{param}" style="display:none;">
<tr><td class="alt1"><object>{param}
</object></tr></td></tbody>
</table>
__________________
Reply With Quote
Reply


Thread Tools
Display Modes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:59 AM.


TitanQuest.net is an Privacy Policy and Legal
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Titan Quest Forums are not affiliated with THQ/Iron Lore.