Jump to content

OnMouseOver popup window in PHP


Dark-Hawk

Recommended Posts

So I'm creating a calendar script and I want people to be able to mouse over the cells and and have a div/popup window come up that lets them enter some information to sign up for something on the date. What I have thus far is this, but it's not right:

 

    	if ($the_day != " "); 
		{
		echo "<a href= '#' id='hoverover' style='cursor:pointer;' onMouseOver='ShowPopup(this);' onMouseOut='HidePopup();'>";
    		echo "$the_day"; 
    		echo '</a>';
		echo "\n";
	}$the_day++;

 

Then for the JavaScript:

<script type='text/javascript'>
function ShowPopup(hoveritem)
{
	hp = document.getElementById('hoverpopup');

	// Set popup to visible
	hp.style.top = hoveritem.offsetTop + 18;
	hp.style.left = hoveritem.offsetLeft + 20;

	hp.style.visibility = 'Visible';
}

function HidePopup()
{
	hp = document.getElementById('hoverpopup');
	hp.style.visibility = 'Hidden';	
}
</script>

 

And the DIV:

<div id='hoverpopup' style='visibility:hidden; position:absolute; top:0; left:0;'>
<table bgcolor='#0000FF'>
  <tr><td><font color='#FFFFFF'>This is my popup</font></td></tr>
  <tr><td bgcolor='#8888FF'>Hello I am a popup table</td></tr>
</table>
</div>

 

So yeah ... that's what I have and I'm unsure how to get it to what I need... Any help is certainly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/153158-onmouseover-popup-window-in-php/
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.