So, I am building a "guided tour" of sorts for a product we are launching. On my website, I have 6 imagebuttons that when clicked call this javascript to show/hide the divs I have the content that each one relates to.
function toggleLayer( whichLayer )
{
var elem, vis;
var all = document.getElementsByTagN
ame("div")
;
// loop all the divs for this page and set them hidden
for (var i=0; i<all.length; i++)
{
if( all[i].id.indexOf('pan_') != -1 )
{
all[i].style.display = "none";
}
}
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( whichLayer );
else if( document.all ) // this is the way old msie versions work
elem = document.all[whichLayer];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[whichLayer
];
vis = elem.style;
// if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.o
ffsetWidth
!=undefine
d&&elem.of
fsetHeight
!=undefine
d)
vis.display = (elem.offsetWidth!=0&&elem
.offsetHei
ght!=0)?'b
lock':'non
e';
vis.display = (vis.display==''||vis.disp
lay=='bloc
k')?'none'
:'block';
}
However, to make sure they dont reset to their hidden state, I have this on all the buttons as well:
search_CityZip.Attributes.
Add("oncli
ck", "return false;");
To avoid a postback which resets the panels to their closed states. What I'd like to do also, is to swap out the picture I have on each button which is currently a blue arrow, with a green arrow. Sounds simple enough, but I can't do this server side, because the buttons don't cause a postback currently. Any help or suggestions would be greatly appreciated!!
Start Free Trial