Jacobb123
02-12-2009, 10:32 PM
I have the following code and I cannot seem to get it to work right
So when the <li class="parent item53"> is hovered over it will invoke the change_el() method but it does not do it. what am I doing wrong?
function sfHover()
{
var sfEls = document.getElementsByTagName("LI");
document.
for (var j=0; j< sfEls.length; j++)
{
if(sfEls[j].className=='parent item53'){
sfEls[j].innerHTML = '<span id= "join")"><a href="/clients/uwin/index.php?option=com_content&view=category&layout=blog&id=29&Itemid=53"><span>Join the Campaign</span></a></span><ul><li class="item61"><a href="/clients/uwin/index.php?option=com_content&view=article&id=20&Itemid=61"><span>Partner Benefits</span></a></li><li class="item62"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=62"><span>Donation</span></a></li><li class="item63"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=63"><span>Merchandising</span></a></li><li class="item64"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=64"><span>Donation Form</span></a></li><li class="item65"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=65"><span>Email Update</span></a></li><li class="item66"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=66"><span>Feedback</span></a></li></ul>';
sfEls[j].className.onMouseover = change_el('join','in')
}
}
}
function change_el(element,type){
alert("jake");
if(type=='in'){
document.getElementById("join").style.position = "relative";
document.getElementById("join").style.left = "50px";
}
if(type == 'out'){
document.getElementById("join").style.position = "relative";
document.getElementById("join").style.left = "-50px";
}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
So when the <li class="parent item53"> is hovered over it will invoke the change_el() method but it does not do it. what am I doing wrong?
function sfHover()
{
var sfEls = document.getElementsByTagName("LI");
document.
for (var j=0; j< sfEls.length; j++)
{
if(sfEls[j].className=='parent item53'){
sfEls[j].innerHTML = '<span id= "join")"><a href="/clients/uwin/index.php?option=com_content&view=category&layout=blog&id=29&Itemid=53"><span>Join the Campaign</span></a></span><ul><li class="item61"><a href="/clients/uwin/index.php?option=com_content&view=article&id=20&Itemid=61"><span>Partner Benefits</span></a></li><li class="item62"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=62"><span>Donation</span></a></li><li class="item63"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=63"><span>Merchandising</span></a></li><li class="item64"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=64"><span>Donation Form</span></a></li><li class="item65"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=65"><span>Email Update</span></a></li><li class="item66"><a href="/clients/uwin/index.php?option=com_content&view=archive&Itemid=66"><span>Feedback</span></a></li></ul>';
sfEls[j].className.onMouseover = change_el('join','in')
}
}
}
function change_el(element,type){
alert("jake");
if(type=='in'){
document.getElementById("join").style.position = "relative";
document.getElementById("join").style.left = "50px";
}
if(type == 'out'){
document.getElementById("join").style.position = "relative";
document.getElementById("join").style.left = "-50px";
}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>