Jump to content

Hover


unidox

Recommended Posts

I have a function that changes a div when an image gets hovered over. The only problem is, I am trying to add an image. Its not working at all, any suggestions?

 

Function:

function swapOnRoster(first_name,last_name,handle,pos,country) {

var rosterHandle = document.getElementById('rosterHandle_'+pos);

rosterHandle.innerHTML = country+first_name+' “'+handle+'” '+last_name;

}

 

PHP:

echo "<a href=\"index.php?p=roster&id=" . $r4['user_id'] . "\" onmouseover=\"swapOnRoster('" . $name[0] . "','" . $name[1] . "','" . $r4['display'] . "', '" . $pos . "', '<img src='images/flags/" . $country . "/" . spaces($r4['country']) . ".png' alt='' /> ')\" onmouseout=\"swapOffRoster('" . $pos . "');\"><img src=\"" . $pic . "\" width=\"50\" height=\"50\" border=\"\" alt=\"\" /></a>";

 

$country gets the first letter of the country, $name is an array for the first/last name, $r4['display'] gets the display name, $pos gets left/right.

 

Just wondering how I can fix this.

Link to comment
https://forums.phpfreaks.com/topic/118281-hover/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.