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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.