Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Layout & Theme > Adding code into a hidden free form text/HTML type widget
Mottie (SuperAdmin) 11/15/2009 5:47 PM EST : Adding code to hide a free form text/HTML type widget
ACK!
Mottie
Posts: 3884

0
Like

0
Dislike

Adding code to a hide a free form text/HTML type widget

GuildPortal admin site link to the original post

This code should be included into a free form text/HTML type widget along with any other code you wish to add to your page. It targets the <div> with the class "hideThisWidget", finds the content box that contains it then hides the entire thing. The other alternative would be to use the custom box HTML from this post, then hide the box ID using CSS.

Code
<!--
********************************************
Add this to your code box
(in a free form text/HTML type content box).
It will hide itself
********************************************
-->
<div class="hideThisWidget"></div>
<script type="text/javascript">
$(document).ready(function(){
  $('.hideThisWidget').closest('.gpWidget').hide();
})
</script>
Customization

There isn't any way to customize this script, but if you have a second widget you wish to hide, add this code to contents.
<div class="hideThisWidget"></div>
Edit (11/19/2009): Updated the original code to work with content boxes that use tables. I also added a second code to work with other layouts.
Edit (11/21/2009): Updated code again to use the widget container, making a second code unnecessary.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%