Click-To-View Text
+3
errik
keerthana
Darkovercast
7 posters
Page 1 of 1
Click-To-View Text
Hello, and nice to meet you. (^^/
While I was working on a post, I came on an issue I'm stuck on figuring out, and need a little push in the right direction.
I'm making quite long posts about a handful of topics, and I need to be able to have some sort of "Click-To-View" text. Much like the [spoiler ] [/spoiler ] code. But I would like it to say "Click Here" (or something along the lines) and if possible, not that long black bar under it.
I would also like to be able to color and italize it. So it stands out to viewers. Any suggestions or things to try?
While I was working on a post, I came on an issue I'm stuck on figuring out, and need a little push in the right direction.
I'm making quite long posts about a handful of topics, and I need to be able to have some sort of "Click-To-View" text. Much like the [spoiler ] [/spoiler ] code. But I would like it to say "Click Here" (or something along the lines) and if possible, not that long black bar under it.
I would also like to be able to color and italize it. So it stands out to viewers. Any suggestions or things to try?
Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
i want to know to about this.whow did you do that keerthana ?please tell me
errik- Forumember
-
Posts : 72
Reputation : 0
Language : Greek
Re: Click-To-View Text
Enable HTML in both the forum and your profile, then try this out in a post :
Edit 'TYPE YOUR MESSAGE HERE!!!!!!!!!!!!!!!!' with what you want to show up as the spoiler.
- 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>
<div class="spoiler">
<input type="button" onclick="showSpoiler(this);" value="Show/Hide" />
<div class="inner" style="display:none;">
TYPE YOUR MESSAGE HERE!!!!!!!!!!!!!!!!
</div>
</div>
</body>
</html>
Edit 'TYPE YOUR MESSAGE HERE!!!!!!!!!!!!!!!!' with what you want to show up as the spoiler.
Rok- Energetic
-
Posts : 6823
Reputation : 234
Language : idk
Re: Click-To-View Text
I started doing what you said to do Rok, and I think i'm on the right steps here, I kinda got it, but i'm getting this.

Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
Blofeld wrote:keerthana wrote:click here to know more
Oh you did that here too did you ? as well as my forum?
Yeah helpful -.- I prefer asking people questions to get better then search engines, you can't say thank you to google.
Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
Can you try it out in a post on your forum and send me the link to that post?
And by the way, when you click on the Show/Hide button, does anything appear correctly?
And by the way, when you click on the Show/Hide button, does anything appear correctly?
Rok- Energetic
-
Posts : 6823
Reputation : 234
Language : idk
Re: Click-To-View Text
Rok wrote:Can you try it out in a post on your forum and send me the link to that post?
And by the way, when you click on the Show/Hide button, does anything appear correctly?
No the Show/Hide box dosnt show anything, ;_; Check your PM box for a pass into the site.
Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
Apparently, I got some jank script from some place on Google.
Here, this is an accurate script:
It should appear like this.
Here, this is an accurate script:
- Code:
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input type="button" value="Click here to view Spoiler!" style="width:130px;height:30px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Click here to view Spoiler!'; }" /></div><div class="quotecontent"><div style="display: none;">{ENTER YOUR TEXT HERE!}</div></div></div>
It should appear like this.
Rok- Energetic
-
Posts : 6823
Reputation : 234
Language : idk
How strange.
Well this box works semi-okay.
Inside my forum, it cuts out the last few letters on the button, kinda looks like "Click here to view spoi-"
But with some tinkering it should be fine.
But the strange thing is, in a new post it works just fine, but the text i'm trying to put inside the button breaks the code and just displays all the text, now I made sure I put it in the right spot and all that, so i'm thinking something inside the text set the button off? Any characters I should'nt have inside the "Enter text here" area?
Inside my forum, it cuts out the last few letters on the button, kinda looks like "Click here to view spoi-"
But with some tinkering it should be fine.
But the strange thing is, in a new post it works just fine, but the text i'm trying to put inside the button breaks the code and just displays all the text, now I made sure I put it in the right spot and all that, so i'm thinking something inside the text set the button off? Any characters I should'nt have inside the "Enter text here" area?
Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
You can insert anything as the title of the spoiler as long as you change the width of the spoiler prior to the amount of characters in the title of the spoiler.
Look for style="width:130px;height:30px;font-size:10px at the beggining of the script. You can tick/edit the width, height, and even the font size for the spoiler.
Look for style="width:130px;height:30px;font-size:10px at the beggining of the script. You can tick/edit the width, height, and even the font size for the spoiler.
Rok- Energetic
-
Posts : 6823
Reputation : 234
Language : idk
Re: Click-To-View Text
I used this code Thank you RokRok wrote:Apparently, I got some jank script from some place on Google.
Here, this is an accurate script:
- Code:
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input type="button" value="Click here to view Spoiler!" style="width:130px;height:30px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Click here to view Spoiler!'; }" /></div><div class="quotecontent"><div style="display: none;">{ENTER YOUR TEXT HERE!}</div></div></div>
It should appear like this.


Re: Click-To-View Text
Success! Thank you very much ROK you were very helpful. The button is perfectly working for me now. 

Darkovercast- New Member
- Posts : 12
Reputation : 0
Language : English
Re: Click-To-View Text
Since this thread appears to be solved, I will lock this thread and mark it as solved.

Sanket

Sanket

Sanket- ForumGuru
-
Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

» when i click view the whole list under whose online
» Click to view full size image
» Text Too Large on Portal View
» Inserting Text and Click Submit in an HTML page
» I cann't see "Forum Terms of service" text when i click register button.
» Click to view full size image
» Text Too Large on Portal View
» Inserting Text and Click Submit in an HTML page
» I cann't see "Forum Terms of service" text when i click register button.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum