Hi,
I'm trying to change a background image used within a list <li>, yet have only been able to get this to work in IE and not Firefox. Please tell me what is wrong with this code:
(Note: I have tried using style.backgroundImage yet that did not work in IE or FF).
document.getElementById(current).style.background="background-image: url('image/arrow_sel.gif') no-repeat";
The complete code is listed below...
Javascript:
<script type="text/javascript">
var current = "woodshed_percussion";
function page_adjust(project)
{
var previous = current;
current = project;
if(current != previous)
{
document.getElementById(current).style.background="background-image: url('image/arrow_sel.gif') no-repeat";
document.getElementById(previous).style.background="background-image: url('image/arrow.gif') no-repeat";
ReplaceElementID("http://www.woodshedpercussion.com/test_environment/rockydesigns/php/main_content.php?project="+ current,"main");
}
}
</script>
and the relevant html:
<div style="margin-bottom: 2em;">
<ul>
<li id="woodshed_percussion" onclick="page_adjust('woodshed_percussion');" style="background-image: url(image/arrow_sel.gif);"><a href="#">Woodshed Percussion</a></li>
<li id="big_mouth" onclick="page_adjust('big_mouth');">Big Mouth Films news blast</li>
<li id="all_island" onclick="page_adjust('all_island');"><a href="#">All Island Music Center </a></li>
<li id="in_pulse" onclick="page_adjust('in_pulse');"><a href="#">In Pulse Chiropractic, P.C.</a></li>
<li id="romanos_tv" onclick="page_adjust('romanos_tv');"><a href="#">Romano's TV & Appliance </a></li>
</ul>
</div>