JayC
Well-Known Member
Hey Devbest I am trying to set it so that my navigator is set to closed instead of open.. Here is the javascript code:
Here is the navigator code:
Image:
Code:
// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {
// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='+';
var hideText='-';
// initialise the visibility check
var is_visible = false;
// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+hideText+'</a>');
// hide all of the elements with a class of 'toggle'
$('.toggle').show();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// switch visibility
is_visible = !is_visible;
// change the link text depending on whether the element is shown or hidden
if ($(this).text()==showText) {
$(this).text(hideText);
$(this).parent().next('.toggle').slideDown('slow');
}
else {
$(this).text(showText);
$(this).parent().next('.toggle').slideUp('slow');
}
// return false so any link destination is not followed
return false;
});
});
Here is the navigator code:
Code:
<h3><font color="lightblue">Navigator</font></h3>
<ul class="toggle"><hr>
<h3><font color="silver">General</h3></font>
<ul class="toggle">
<li class="icn_tags"><a href="%www%/me.php"><font color="white">Me</a></li></font>
<li class="icn_tags"><a href="%www%/community.php"><font color="white">Community</a></li></font>
<li class="icn_tags"><a href="%www%/vip"><font color="white">Shop</a></li></font>
</ul><hr>
<h3><font color="silver">Community</h3></font>
<ul class="toggle">
<li class="icn_profile"><a href="%www%/articles"><font color="white">News</a></li></font>
<li class="icn_profile"><a href="%www%/topstats.php"><font color="white">Top Stats</a></li></font>
<li class="icn_profile"><a href="%www%/tos.php"><font color="white">Terms of Service</a></li></font>
<li class="icn_profile"><a href="%www%/rotw.php"><font color="white">ROTW Info</a></li></font>
</ul><hr>
<h3><font color="silver">Shop</h3></font>
<ul class="toggle">
<li class="icn_profile"><a href="%www%/badgeshop.php"><font color="white">Badge Shop</a></li></font>
<li class="icn_profile"><a href="%www%/pixels.php"><font color="white">Pixel Shop</a></li></font>
<li class="icn_profile"><a href="%www%/coins.php"><font color="white">Credit Shop</a></li></font>
<li class="icn_profile"><a href="%www%/vippoints.php"><font color="white">Shell Shop</a></li></font>
</ul><hr>
<h3><font color="silver">Staff</h3></font>
<ul class="toggle">
<li class="icn_profile"><a href="%www%/vipmembers.php"><font color="white">VIP Members</a></li></font>
<li class="icn_profile"><a href="%www%/experts.php"><font color="white">eXperts</a></li></font>
<li class="icn_profile"><a href="%www%/events.php"><font color="white">Events</a></li></font>
<li class="icn_profile"><a href="%www%/community/staff"><font color="white">Management</a></li></font>
</ul><hr>
<h3><font color="silver">Extras</h3></font>
<ul class="toggle">
<li class="icn_profile"><a href="%www%/tinychat.php"><font color="white">Tinychat</a></li></font>
<li class="icn_profile"><a href="%www%/lottery.php"><font color="white">Lottery</a></li></font>
<li class="icn_profile"><a href="%www%/vault.php"><font color="white">Vault</a></li></font>
</ul><hr>
<?php if ($users->hasFuse(USER_ID, 'fuse_housekeeping_login')) { ?>
<h3><font color="red">Housekeeping</h3></font>
<li class="icn_profile"><a href="%www%/allseeingeye/index.php"><font color="white">HouseKeeping</a></li></font>
<?php } ?><br>
Image: