Digital Point Forums
Wire Transfer

Go Back   Digital Point Forums > Design & Development > HTML & Website Design
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Mar 25th 2008, 9:19 am
SamuraiZero's Avatar
SamuraiZero SamuraiZero is offline
Twilight Vanquisher
 
Join Date: Jan 2008
Posts: 594
SamuraiZero is on a distinguished road
Spoiler HTML Code! Help!

Need help with what im sure is very basic, but Im not sure what to google.

Basically, I want to code a piece that will say "Click here for spoilers" or something, that will then expand to show hidden text..

Let me know if im not being clear with what i want!

Thanks in advance!
Reply With Quote
  #2  
Old Mar 25th 2008, 9:45 am
Morishani Morishani is offline
Champion of the Naaru
 
Join Date: Jul 2006
Posts: 239
Morishani is on a distinguished road
Oh you are clear enough, check this out :

html4strict Code:
<html>
<head>
    <title>Spoiler HTML code</title>
    <style type="text/css">
body,input
    {
    font-family:"Trebuchet ms",arial;font-size:0.9em;
    color:#333;
    }
.spoiler
    {
    border:1px solid #ddd;
    padding:3px;
    }
.spoiler .inner
    {
    border:1px solid #eee;
    padding:3px;margin:3px;
    }
    </style>
    <script type="text/javascript">
function showSpoiler(obj)
    {
    var inner = obj.parentNode.getElementsByTagName("div")[0];
    if (inner.style.display == "none")
        inner.style.display = "";
    else
        inner.style.display = "none";
    }
    </script>
</head>
<body>
<h1>Spoiler HTML w/Js Code by Skrap</h1>
<div class="spoiler">
    <input type="button" onclick="showSpoiler(this);" value="Show/Hide" />
    <div class="inner" style="display:none;">
    This is a spoiler!
    </div>
</div>
</body>
</html>
Live example

Good luck
__________________
מטבחים (Hebrew) | בניית אתרים (Hebrew)
Reply With Quote
Reply

Bookmarks

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a spoiler Verne Graphics & Multimedia 14 Sep 14th 2007 11:51 am
Spoiler Code improvement needed blueparukia JavaScript 2 Aug 1st 2007 3:20 pm
Good at HTML tables? You code me HTML, I'll code you XHTML/CSS extensiblecascade HTML & Website Design 4 Jun 8th 2007 2:07 am
convert html code to javascript code Arians JavaScript 3 Mar 24th 2007 3:22 am
Include common HTML code within another HTML doc Garrett HTML & Website Design 4 Aug 31st 2006 3:06 am


All times are GMT -8. The time now is 3:06 pm.