Expandable text?

TappedOut forum

Posted on Jan. 14, 2014, 7:35 p.m. by Lord007

I've seen a few decks where in the description they have parts where a paragraph or two is hidden under a single word that you click to view/hide the text. I'm looking for how you do that. Thanks :)

Matsi883 says... #2

Ok, so:

In order to do this, you create a huge wall of HTML on one line. I'll put the code here on multiple lines, but in a deck, it needs to be on one line. Where I say BUTTON TEXT BEFORE REVEAL, it's the text on the button before it's clicked. Just use common sense. So, the code:

< div >< /a >< /p >< a id="show_id" onclick="document.getElementById('spoiler_id').style.display=''; document.getElementById('show_id').style.display='none';" class="link">BUTTON TEXT BEFORE REVEAL
January 14, 2014 7:50 p.m.

Lord007 says... #3

Thank you. I'll be implementing that soon on my decks.

January 14, 2014 10:15 p.m.

Blizzicane says... #4

Hmmmm... I might just need to take that line of code as well. >:3

January 14, 2014 10:21 p.m.

Lord007 says... #5

For some reason I can't get this to work. Could you explain maybe in more detail?

January 14, 2014 10:29 p.m.

Lord007 says... #6

January 14, 2014 10:30 p.m.

Lord007 says... #7

For instance, where do I put the text I want hidden?

January 14, 2014 10:35 p.m.

Matsi883 says... #8

Ok. Half of that was lost, so I'll try again:


< div >< a id="showCodeIdentifier_id" onclick="document.getElementById('spoilerCodeIdentifier_id').style.display=''; document.getElementById('showCodeIdentifier_id').style.display='none';" class="link" >Show Text Here< /a >

< span id="spoilerCodeIdentifier_id" style=

"display: none" >< a onclick="document.getElementById('spoilerCodeIdentifiert_id')

.style.display='none'; document.getElementById('showCodeIdentifier_id')

.style.display='';" class="link" >Hide Text Here< /a >

HIDDEN TEXT

< /span >< /div >


It all needs to be on one line, and CodeIdentifier needs to be different every time this is on a page.

January 15, 2014 7:13 a.m.

Lord007 says... #9

Matsi883 CodeIdentifier can be changed to anything? also, it's still not working right. I've never programed before so maybe I'm missing something obvious.

January 15, 2014 8:50 p.m.

Matsi883 says... #10

Copy and paste what you're doing, Lord007.

January 16, 2014 7:12 a.m.

Lord007 says... #11

< div >< a id="showCodeIdentifier_id" onclick="document.getElementById('spoilerCodeIdentifier_id').style.display=''; document.getElementById('showCodeIdentifier_id').style.display='none';" class="link" >Show Text Here< /a >< span id="spoilerCodeIdentifier_id" style="display: none" >< a onclick="document.getElementById('spoilerCodeIdentifiert_id').style.display='none';document.getElementById('showCodeIdentifier_id').style.display='';" class="link" >Control Strategy< /a >4 Savage Summoning must come in. MUST.Elixir of Immortality might come in to recycle my win con.

Fade into Antiquity should come in for Detention Sphere (kinda a trick, play the Zhur-Taa Druid , let them get it under the sphere, then I only have to Savage Summoning the Elite Arcanist with a Hammer of Purphoros on the field, grab my duid back and win) and Pithing Needle .

Turn / Burn maybe? depends on whether the deck runs AEtherling or Elspeth, Sun's Champion as the win con, how many Mutavault s the deck has. If it has a full 4 Mutavault and AEtherling then Turn / Burn might come in. But it isn't a must sideboard plan.

Essence Scatter almost certainly needs to stay out. It might come in if their only win con is AEtherling to make it that much harder to resolve their win con but again, not a must sideboard plan.

AEtherize might have a place due to their win con still having to attack me. These last couple of cards are ones I haven't completely figured out a sideboard plan.

Cards that can come out:

Anger of the Gods self explanatory, If I'm the only one with creatures, why should I kill all of them?

AEtherize if my opponent doesn't have many creatures, why should I get rid of the attacking creatures? It can still have a place because they do still have to attack to win.

Hammer of Purphoros because I'm endsteping the win with Savage Summoning this can come out. This however can be a good alternate win con and with a control game I will hit plenty of land drops to sac to the hammer.

Omenspeaker It will never resolve against a control deck and in a control matchup I have time to find my combo so the scry 2 is less relevant. It can almost certainly come out although an argument can be made that scrying is even more important because I need more "pieces" to my combo.

Magma Jet can be taken out although it is the best way to scry because it can be endsteped.

Thoughtflare same argument as Magma Jet

Simic Charm and Mizzium Skin . Depends on whether it is a U/W control or a U/W/X control. In U/W some can come out, in U/W/X they need to stay in for kill/burn spells.< /span >< /div >

Maybe you can find what I'm doing wrong...

January 16, 2014 7:40 a.m.

Matsi883 says... #12

So, I'm just going to paste everything as one line, with (br) for line spacing:

< div >< /a >< /p >< a id="show_id" onclick="document.getElementById('spoiler_id').style.display=''; document.getElementById('show_id').style.display='none';" class="link" >SHOW< /a >< span id="spoiler_id" style="display: none" >< a onclick="document.getElementById('spoiler_id').style.display='none'; document.getElementById('show_id').style.display='';" class="link" >Control Strategy< /a >< br >< /p >< p >

Savage Summoning must come in. MUST.Elixir of Immortality might come in to recycle my win con.Fade into Antiquity should come in for Detention Sphere (kinda a trick, play the Zhur-Taa Druid , let them get it under the sphere, then I only have to Savage Summoning the Elite Arcanist with a Hammer of Purphoros on the field, grab my dude back and win) and Pithing Needle .< br >Turn / Burn maybe? depends on whether the deck runs AEtherling or Elspeth, Sun's Champion as the win con, how many Mutavault s the deck has. If it has a full 4 Mutavault and AEtherling then Turn / Burn might come in. But it isn't a must sideboard plan.< br >Essence Scatter almost certainly needs to stay out. It might come in if their only win con is AEtherling to make it that much harder to resolve their win con but again, not a must sideboard plan.< br >AEtherize might have a place due to their win con still having to attack me. These last couple of cards are ones I haven't completely figured out a sideboard plan.< br >< h2 >Cards that can come out:< /h2 >< br >Anger of the Gods self explanatory, If I'm the only one with creatures, why should I kill all of them? < br >AEtherize if my opponent doesn't have many creatures, why should I get rid of the attacking creatures? It can still have a place because they do still have to attack to win.< br >Hammer of Purphoros because I'm endsteping the win with Savage Summoning this can come out. This however can be a good alternate win con and with a control game I will hit plenty of land drops to sac to the hammer.< br >Omenspeaker It will never resolve against a control deck and in a control matchup I have time to find my combo so the scry 2 is less relevant. It can almost certainly come out although an argument can be made that scrying is even more important because I need more "pieces" to my combo. < br >Magma Jet can be taken out although it is the best way to scry because it can be endsteped.< br >Thoughtflare same argument as Magma Jet < br >Simic Charm and Mizzium Skin . Depends on whether it is a U/W control or a U/W/X control. In U/W some can come out, in U/W/X they need to stay in for kill/burn spells.< /p >< p >< /div >< /span >< brclear=all >


Just paste this in, take out the spaces between the HTML tags, and you should be set to go. Also, I should say this is Cyrrus's code, as to not be bragging. Oh, and sorry for the wall of text, but you'll need it.

January 16, 2014 5:36 p.m.

Lord007 says... #13

Ok... here's the link to the deck I'm trying to do this on. I've gotten to a nice blue hyperlink that does nothing when you click on it.


Elite Taactics Playtest

Standard Lord007

SCORE: 105 | 15 COMMENTS | 10210 VIEWS

January 16, 2014 6:13 p.m.

Lord007 says... #14

Apparently I just had to give it a refresh. It works now, thanks for your help

January 16, 2014 6:14 p.m.

Lord007 says... #15

And really quick, one last question, what do I have to change to use the same code on the same page?

January 16, 2014 6:26 p.m.

Matsi883 says... #16

Mine uses show.id and spoiler.id, and another one I showed you (I've been jumping back and forth) uses CodeIdentifier. Whatever you use in that location has to be unique in that page.

Also, as I posted on your deck, remember to link cards in your description.

January 16, 2014 6:28 p.m.

Matsi883 says... #17

Ah... much better and easier to read. It works perfectly.

January 16, 2014 6:30 p.m.

This discussion has been closed