t_schwarz
10-02-2009, 03:27 AM
I am definitely an ajax novice, but I do know some sql, vb.net and actionscript 3.
I have set up a page div'd into 2 sections. The left section has a menu and the right has the content. I am updating an object on the content side with html via javascript and it is working fine, but since the menu is on the left side and the left div never refreshes I cannot figure out how to show a selected state for the menu selection chosen.
Thanks,
T
<script type="text/javascript">
function updateObjectIframe(which,nm){
document.getElementById('stuff').innerHTML = '<'+'object id="stuffit" name="stuffit" type="text/html" data="'+which.href+'"><\/object>';
document.getElementById("content").style.backgroundImage = "url("+nm+")";
}
</script>
#menu {
width: 125px;
border-style: solid solid none solid;
border-color: #94AA74;
border-width: 0px;
position: relative;
top:0px;
}
#menu ul{
list-style:none;
padding:0px;
margin:0px;
}
#menu li a {
height: 32px;
height: 24px;
text-decoration: none;
font-weight:normal;
}
#menu li a:link, #menu li a:visited {
color: #333333;
display: block;
background: url(images/menu1.gif);
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:hover {
color: #26370A;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -32px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:active {
color: #333333;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -64px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:selected {
color: #868686;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -50px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
<div id="menu">
<ul id="menus">
<li class="home"><a href="ashome.html" onClick="var nm = 'images/brndHome.jpg'; updateObjectIframe(this,nm);return false;">Home</a></li>
<li class="apps"><a href="asapps.html" onClick="var nm = 'images/brndApps.jpg'; updateObjectIframe(this,nm);return false;">Applications</a></li>
<li class="patterns"><a href="aspatterns.html" onClick="var nm = 'images/brndPatterns.jpg'; updateObjectIframe(this,nm);return false;">Patterns</a></li>
<li class="tech"><a href="astech.html" onClick="var nm = 'images/brndTech.jpg'; updateObjectIframe(this,nm);return false;">Technical</a></li>
<li class="contact"><a href="ascontact.html" onClick="var nm = 'images/brndContact.jpg'; updateObjectIframe(this,nm);return false;">Contact</a></li>
</ul>
</div>
I have set up a page div'd into 2 sections. The left section has a menu and the right has the content. I am updating an object on the content side with html via javascript and it is working fine, but since the menu is on the left side and the left div never refreshes I cannot figure out how to show a selected state for the menu selection chosen.
Thanks,
T
<script type="text/javascript">
function updateObjectIframe(which,nm){
document.getElementById('stuff').innerHTML = '<'+'object id="stuffit" name="stuffit" type="text/html" data="'+which.href+'"><\/object>';
document.getElementById("content").style.backgroundImage = "url("+nm+")";
}
</script>
#menu {
width: 125px;
border-style: solid solid none solid;
border-color: #94AA74;
border-width: 0px;
position: relative;
top:0px;
}
#menu ul{
list-style:none;
padding:0px;
margin:0px;
}
#menu li a {
height: 32px;
height: 24px;
text-decoration: none;
font-weight:normal;
}
#menu li a:link, #menu li a:visited {
color: #333333;
display: block;
background: url(images/menu1.gif);
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:hover {
color: #26370A;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -32px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:active {
color: #333333;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -64px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
#menu li a:selected {
color: #868686;
text-decoration: underline;
font-weight:bold;
background: url(images/menu1.gif) 0 -50px;
background-repeat:no-repeat;
padding: 8px 0 0 10px;
}
<div id="menu">
<ul id="menus">
<li class="home"><a href="ashome.html" onClick="var nm = 'images/brndHome.jpg'; updateObjectIframe(this,nm);return false;">Home</a></li>
<li class="apps"><a href="asapps.html" onClick="var nm = 'images/brndApps.jpg'; updateObjectIframe(this,nm);return false;">Applications</a></li>
<li class="patterns"><a href="aspatterns.html" onClick="var nm = 'images/brndPatterns.jpg'; updateObjectIframe(this,nm);return false;">Patterns</a></li>
<li class="tech"><a href="astech.html" onClick="var nm = 'images/brndTech.jpg'; updateObjectIframe(this,nm);return false;">Technical</a></li>
<li class="contact"><a href="ascontact.html" onClick="var nm = 'images/brndContact.jpg'; updateObjectIframe(this,nm);return false;">Contact</a></li>
</ul>
</div>