PDA

View Full Version : function Change Visibility



DeeVeeEight
06-11-2009, 02:21 AM
I'm trying to customize my IMVU home page and I seem to be getting errors with the below code. Is the syntax correct, or is there a better way to write this code?

What I'm trying to do...

The imvu home pages are made up of several "panels" and members can add their own code to the panels to change the look of their home pages. What I am trying to do is get the panels all positioned on the top, make them invisible, then change the panels visibility when the user clicks the cascading style sheet menu button.

Kind of Like creating navagation to the desired panel. Only instead of the panels being viewable at the same time, I want to create less scrolling for the viewer by having each panel hovering on top of one another, all hidden, visable only when a button is clicked.

When I try to view the page I get this "error code".

Line: 1112
Char: 3
Error: Object Required
Code: 0
URL: http://avatars.imvu.com/DeeVee8



<script type="text/javascript">
function changeVisibility(panelName,menuButton)
{
document.getElementById('mb1').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById('mb2').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById('mb3').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById('mb4').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById('mb5').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById('mb6').style.background='url(http://defaultblock.gif) center center repeat-x';
document.getElementById(menuButton).style.background = 'url(http://activeblock.gif) center center repeat-x';

document.getElementById('tagcloud_panel').style.visibility="hidden";
document.getElementById('rankings_panel').style.visibility="hidden";
document.getElementById('friends_panel').style.visibility="hidden";
document.getElementById('music_panel').style.visibility="hidden";
document.getElementById('dev_panel').style.visibility="hidden";
document.getElementById('wishlist_panel').style.visibility="hidden";
document.getElementById(panelName).style.visibility="visible";
}
function enterSite()
{
document.getElementById('aboutme_panel').style.visibility="hidden";
document.getElementById('url_panel').style.visibility="visible";
document.getElementById('tagcloud_panel').style.visibility="visible";
document.getElementById('visitors_panel').style.visibility="visible";
document.getElementById('badges_panel').style.visibility="visible";
}
</script>

I've only included the JavaScript because the error seems to be with this section of code. I can provide "all" modified sections if needed.

Thanks in advance for your help.