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
<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>
<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>
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.
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>
<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><
Topic Solved & Locked |