We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Show/Hide Script
Topic Started: Sep 2 2015, 12:45 AM (277 Views)
FB92
Member Avatar
Member
[ *  * ]
Is there a show/hide script available that by default hides the custom profile fields until the 'Show' button? is clicked?

I am wanting to hide this by default but still allow a member to click show to see the content.

You'll see why.
Posted Image
It takes up far too much space by default.
http://adminvault.net/topic/8040681/1/
Offline Profile Goto Top
 
Roby
Member Avatar
#27

Javascripts
Code:
 
<style type="text/css">
dl.user_profile dd, dl.user_profile dt {
display: none;
}
span.toggle_user_profile {
font-weight: bold;
}
</style>
Below the Board
Code:
 
<script type="text/javascript">
$(function() {
var current_location = location.href;
if (current_location.indexOf('/topic/') !== -1 || current_location.indexOf('/single/') !==-1) {
$('td.c_user dl.user_profile.').each(function() {
$(this).append('<span class="toggle_user_profile">Click to Toggle</span>');
$(this).click(function() {
$(this).find('dd, dt, span.toggle_user_profile').toggle();
});
});
}
});
</script>
Offline Profile Goto Top
 
FB92
Member Avatar
Member
[ *  * ]
How do a display a Hide this toggle?
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

FB92
Sep 2 2015, 01:43 AM
How do a display a Hide this toggle?
Do you mean to disable the toggling feature?
Offline Profile Goto Top
 
Roby
Member Avatar
#27

Is this what you mean:

Javascripts
Code:
 
<style type="text/css">
dl.user_profile dd, dl.user_profile dt {
display: none;
}
span.toggle_user_profile {
font-weight: bold;
}
span.toggle_show_hide {
font-weight: bold;
display: none;
}
</style>

Below the Board
Code:
 
<script type="text/javascript">
$(function() {
var current_location = location.href;
if (current_location.indexOf('/topic/') !== -1 || current_location.indexOf('/single/') !==-1) {
$('td.c_user dl.user_profile.').each(function() {
$(this).append('<span class="toggle_user_profile">Click for more...</span><span class="toggle_show_hide">Click to hide...</span>');
$(this).click(function() {
$(this).find('dd, dt, span.toggle_user_profile, span.toggle_show_hide').toggle();
});
});
}
});
</script>
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Roby
Sep 2 2015, 10:30 AM
Is this what you mean:

Javascripts
Code:
 
<style type="text/css">
dl.user_profile dd, dl.user_profile dt {
display: none;
}
span.toggle_user_profile {
font-weight: bold;
}
span.toggle_show_hide {
font-weight: bold;
display: none;
}
</style>

Below the Board
Code:
 
<script type="text/javascript">
$(function() {
var current_location = location.href;
if (current_location.indexOf('/topic/') !== -1 || current_location.indexOf('/single/') !==-1) {
$('td.c_user dl.user_profile.').each(function() {
$(this).append('<span class="toggle_user_profile">Click for more...</span><span class="toggle_show_hide">Click to hide...</span>');
$(this).click(function() {
$(this).find('dd, dt, span.toggle_user_profile, span.toggle_show_hide').toggle();
});
});
}
});
</script>


A computer dies everytime `$(this)` isn't cached
Code:
 
<script type="text/javascript">
$(function() {
var current_location = location.href;
if (current_location.indexOf('/topic/') !== -1 || current_location.indexOf('/single/') !==-1) {
$('td.c_user dl.user_profile.').each(function() {
var $this = $(this);
$this.append('<span class="toggle_user_profile">Click for more...</span><span class="toggle_show_hide">Click to hide...</span>');
$this.click(function(){
$(this).find('dd, dt, span.toggle_user_profile, span.toggle_show_hide').toggle();
});
});
}
});
</script>


Please. Don't let these computers die needlessly by drinking uncached code. For just one minute everyday you can use `$this` to help preserve the lives of these computers. Thank you ;)
Offline Profile Goto Top
 
Roby
Member Avatar
#27

Quozzo
Sep 2 2015, 12:24 PM
A computer dies everytime `$(this)` isn't cached. Please. Don't let these computers die needlessly by drinking uncached code. For just one minute everyday you can use $this to help preserve the lives of these computers. Thank you
Ahh, thanks ^_^

FB92, replace the Below the Board part with what Quozzo posted. The Javascripts part can stay the same.
Offline Profile Goto Top
 
FB92
Member Avatar
Member
[ *  * ]
Thank you so much! :)
Offline Profile Goto Top
 
Jason
Member Avatar
Member
[ *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic