How to make show&Hide button like this
5 posters
Page 1 of 1
How to make show&Hide button like this
Give me the code please
my forum is PHPbb2
*sorry for my bad english
Last edited by MassKilling on July 29th 2012, 4:03 am; edited 2 times in total
MassKilling- Forumember
- Posts : 33
Reputation : 2
Language : Indonesia
Location : Indonesia
MassKilling- Forumember
- Posts : 33
Reputation : 2
Language : Indonesia
Location : Indonesia
Re: How to make show&Hide button like this
Hey youre from indonesia lol mee too and halo MassKilling
and it's type of toggle and the problem for your forum must be PunBB And Phpbb2
and it's type of toggle and the problem for your forum must be PunBB And Phpbb2
Re: How to make show&Hide button like this
That is not very hard to do, actually.
I believe that is the Homepage Message, so you'd need to put the following code (after edited) in that.
So where it says "Title Here" you put the title of your content or something along the lines of "Show Content" and for "Your HTML/Text Here", you put your HTML or Text or etc. You can change "Hide" as well.
I hope this is what you're looking for.
I believe that is the Homepage Message, so you'd need to put the following code (after edited) in that.
- Code:
<style type="text/css">
div {
position: absolute;
left: 0px;
top: 29px;
width: 280px;
padding: 10px;
color: black;
border: none;
display: none;
}
</style>
<script language="JavaScript">
function setVisibility(id) {
if(document.getElementById('bt1').value=='Hide'){
document.getElementById('bt1').value = 'Title Here';
document.getElementById(id).style.display = 'none';
}else{
document.getElementById('bt1').value = 'Hide';
document.getElementById(id).style.display = 'inline';
}
}
</script>
<input type=button name=type id='bt1' value='Title Here' onclick="setVisibility('sub3');";>
<div id="sub3">Your HTML/Text Here
</div>
So where it says "Title Here" you put the title of your content or something along the lines of "Show Content" and for "Your HTML/Text Here", you put your HTML or Text or etc. You can change "Hide" as well.
I hope this is what you're looking for.
Re: How to make show&Hide button like this
it doesn't work
if i copy that code in my homepage message
my forum is blank
*sorry for my bad english
if i copy that code in my homepage message
my forum is blank
*sorry for my bad english
MassKilling- Forumember
- Posts : 33
Reputation : 2
Language : Indonesia
Location : Indonesia
Re: How to make show&Hide button like this
Oh! I'm so sorry, the code should be:
Sorry, I forgot to put the #sub3 on the div.
- Code:
<style type="text/css">
div#sub3 {
position: absolute;
left: 0px;
top: 29px;
width: 280px;
padding: 10px;
color: black;
border: none;
display: none;
}
</style>
<script language="JavaScript">
function setVisibility(id) {
if(document.getElementById('bt1').value=='Hide'){
document.getElementById('bt1').value = 'Title Here';
document.getElementById(id).style.display = 'none';
}else{
document.getElementById('bt1').value = 'Hide';
document.getElementById(id).style.display = 'inline';
}
}
</script>
<input type=button name=type id='bt1' value='Title Here' onclick="setVisibility('sub3');";>
<div id="sub3">Your HTML/Text Here
</div>
Sorry, I forgot to put the #sub3 on the div.
Re: How to make show&Hide button like this
if i put the code to my homepage message,lilyheart7 wrote:Oh! I'm so sorry, the code should be:
- Code:
<style type="text/css">
div#sub3 {
position: absolute;
left: 0px;
top: 29px;
width: 280px;
padding: 10px;
color: black;
border: none;
display: none;
}
</style>
<script language="JavaScript">
function setVisibility(id) {
if(document.getElementById('bt1').value=='Hide'){
document.getElementById('bt1').value = 'Title Here';
document.getElementById(id).style.display = 'none';
}else{
document.getElementById('bt1').value = 'Hide';
document.getElementById(id).style.display = 'inline';
}
}
</script>
<input type=button name=type id='bt1' value='Title Here' onclick="setVisibility('sub3');";>
<div id="sub3">Your HTML/Text Here
</div>
Sorry, I forgot to put the #sub3 on the div.
the result is
- result:
it doesn't workRideem3 wrote:Put this in an announcement or wherever you want the toggling to occur:
- Code:
<div id="toggle_ele">Your content here</div>
<input type="button" onClick="toggleEle('toggle_ele');" value="Toggle" />
<script type="text/javascript">
function toggleEle(id) {
if (document.getElementById(id).style.display != "none") document.getElementById(id).style.display = "none";
else (document.getElementById(id).style.display = "block";
}
</script>
my content doesn't appear
to you for trying to help me
*sorry for my bad english
MassKilling- Forumember
- Posts : 33
Reputation : 2
Language : Indonesia
Location : Indonesia
Re: How to make show&Hide button like this
Try this one:
- Code:
<style type="text/css">
div#sub3 {
position: absolute;
left: 0px;
top: auto;
padding: 20px;
color: black;
border: none;
display: none;
}
</style>
<script language="JavaScript">
function setVisibility(id) {
if(document.getElementById('bt1').value=='Hide'){
document.getElementById('bt1').value = 'Title Here';
document.getElementById(id).style.display = 'none';
}else{
document.getElementById('bt1').value = 'Hide';
document.getElementById(id).style.display = 'inline';
}
}
</script>
<input type=button name=type id='bt1' value='Title Here' onclick="setVisibility('sub3');";>
<div id="sub3">Your HTML/Text Here
</div><
Re: How to make show&Hide button like this
Please see the tutorial here.
http://www.webartzforum.com/t903-making-show-hide-content
You can see the working demo here.
http://webartzdemo.forumotion.com/Show-Hide-Content-h15.htm
http://www.webartzforum.com/t903-making-show-hide-content
You can see the working demo here.
http://webartzdemo.forumotion.com/Show-Hide-Content-h15.htm
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Re: How to make show&Hide button like this
Thank you Sanket
Solved.
Solved.
MassKilling- Forumember
- Posts : 33
Reputation : 2
Language : Indonesia
Location : Indonesia
Re: How to make show&Hide button like this
Topic Solved & Locked |
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Similar topics
» Hide emoticons button in Cbox?
» How do you get a "hide category button"
» can i hide the quote button from topic owner
» Need help with javascript to hide button
» Hide Login/Register button
» How do you get a "hide category button"
» can i hide the quote button from topic owner
» Need help with javascript to hide button
» Hide Login/Register button
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum