Jump to content

Need help adding Hover over text Image to PHP


Marsha

Recommended Posts

Hey

My code follows :)

 

echo '<td align="center"><a href="' . $scripturl . '?action=downloads;sa=view;down=' . $row['ID_FILE'] . '">',$row['title'],'</a><br />';

Basically ID_FILE is a file ID for a download, and ['title'] is the title name for that download.

I want to merge this into the following code

<body>

<a id="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);"

 

onMouseOut="HidePopup();"> TITLE HERE </a>

<div id="hoverpopup" style="visibility:hidden; position:absolute; top:0; left:0;">

<img src="/images/ ['title'] .png"></font></td></tr>

</div></body>

 

So that the code is inside the first code's link...

so then, the Title is the text that I scroll over to pop up the Image, which is drawn from /images/ and the title name as the file name, so $row['title'], then I guess thats it... :)

 

By the way, the Second code is part of a javascript, which is in the following quote just incase you need it.

<script type="text/javascript">

function ShowPopup(hoveritem)

{

hp = document.getElementById("hoverpopup");

 

// Set position of hover-over popup

hp.style.top = hoveritem.offsetTop + 18;

hp.style.left = hoveritem.offsetLeft + 20;

 

// Set popup to visible

hp.style.visibility = "Visible";

}

 

function HidePopup()

{

hp = document.getElementById("hoverpopup");

hp.style.visibility = "Hidden";

}

</script>

I've tried a few times but I just can't crack it,

Thanks for any help :)

Marshall

lol yeah sorry I didn't explain very well.

 

Ok so $row['title'] is a name of a download that is collected from mysql

and ID_FILE is the ID number for that download, also collected from mysql

 

I need the second quote to go into the first quotes link. so <a href="link"> HERE </a>

 

and I also need the $row['title'] to go where I put "TITLE HERE" in the second quote

 

I just keep getting errors when I do it and I don't know exactly where to put stuff lol

 

:)

Thanks

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.