How can I add a show/hide button for "who is online?" section?
Last edited by iamthestreets on January 17th 2012, 4:47 pm; edited 1 time in total
Rideem3 wrote:Do you want to automatically hide it, and then have a button to show it?
Or do you want to show it a add a button that will hide it?
<script type="text/javascript">
function showstats() {
$(document).ready(function() {
$('.hiddenstat').show('slow');
});
document.getElementById('showS').style.display = "none";
document.getElementById('hideS').style.display = "inline-block";
}
function hidestats() {
$(document).ready(function() {
$('.hiddenstat').hide('slow');
});
document.getElementById('showS').style.display = "inline-block";
document.getElementById('hideS').style.display = "none";
}
</script>
<script type="text/javascript">
function togglestats() {
var x=document.getElementById('showS').style.display = "none";
if (x.style.display!='none') {
$('.hiddenstat').show('slow');
x.style.display = "none";
document.getElementById('hideS').style.display = "inline-block";
} else {
$('.hiddenstat').hide('slow');
x.style.display = "inline-block";
document.getElementById('hideS').style.display = "none";
}
</script>
<input type="button" value="Show Statistics" onclick="showstats()" id="showS"/><input style="display: none;" type="button" value="Hide Statistics" onclick="hidestats()" id="hideS" /></span>
<!-- END switch_viewonline_link -->
<input type="button" value="Show Statistics" onclick="togglestats()" id="showS"/><input style="display: none;" type="button" value="Hide Statistics" onclick="togglestats()" id="hideS" /></span>
<!-- END switch_viewonline_link -->
iamthestreets wrote:This is what it shows:
The second code LGForum gave me doesn't do anything and it takes away the who is online?
<script type="text/javascript">
function togglestats() {
var x=document.getElementById('showS');
if (x.style.display!='none') {
$('.hiddenstat').show('slow');
x.style.display = "none";
document.getElementById('hideS').style.display = "inline-block";
} else {
$('.hiddenstat').hide('slow');
x.style.display = "inline-block";
document.getElementById('hideS').style.display = "none";
}}
</script>
Rideem3 wrote:Actually, the reason why it's displaying the birthday is because it's displayed as a PHP variable. For some reason I can't give it the class I gave the others.
LGforum wrote:iamthestreets wrote:This is what it shows:
The second code LGForum gave me doesn't do anything and it takes away the who is online?
Lol woops. Thats because there was a slight silly error in it. It should have been this:
- Code:
<script type="text/javascript">
function togglestats() {
var x=document.getElementById('showS');
if (x.style.display!='none') {
$('.hiddenstat').show('slow');
x.style.display = "none";
document.getElementById('hideS').style.display = "inline-block";
} else {
$('.hiddenstat').hide('slow');
x.style.display = "inline-block";
document.getElementById('hideS').style.display = "none";
}}
</script>
EDIT: this code above now works perfectly.
.hiddenstat+tr{display:none;}
$( $('.hiddenstat')[1].nextSibling ).toggle();
iamthestreets wrote:LGforum wrote:iamthestreets wrote:This is what it shows:
The second code LGForum gave me doesn't do anything and it takes away the who is online?
Lol woops. Thats because there was a slight silly error in it. It should have been this:
- Code:
<script type="text/javascript">
function togglestats() {
var x=document.getElementById('showS');
if (x.style.display!='none') {
$('.hiddenstat').show('slow');
x.style.display = "none";
document.getElementById('hideS').style.display = "inline-block";
} else {
$('.hiddenstat').hide('slow');
x.style.display = "inline-block";
document.getElementById('hideS').style.display = "none";
}}
</script>
EDIT: this code above now works perfectly.
Thanks it worked, but is there any way to put the "Who is Online?" text back?
This it what it shows as now:
Can it show like this:
And is there any way possible to remove the birthday info?
LGforum wrote:You can remove the birthday info by adding this in the CSS:
- Code:
.hiddenstat+tr{display:none;}
Topic Solved & Locked |