...

View Full Version : Mouse Over Gives Popup



techgearfree
01-30-2005, 04:02 AM
I have been searching like crazy, and cannot find out how to code what I want.

I want to have a roll over description exactly like this site:

www.freeipods.com (note, I am not spamming, I really want to do that rollover thing)

Thanks

hemebond
01-31-2005, 05:11 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>51244</title>
</head>
<body>
<dl>
<dt>Object 1</dt>
<dd>
<p>This is the description for Object 1</p>
</dd>

<dt>Object 2</dt>
<dd>
<p>This is the description for Object 2</p>
</dd>
</dl>

<script type="text/javascript">
var dt = document.getElementsByTagName("dt");
var dd = document.getElementsByTagName("dd");

for(var i = 0; i < dt.length; i++)
{
dt[i].addEventListener("mouseover",toggleSibling,true);
dt[i].addEventListener("mouseout",toggleSibling,true);
}

for(var i = 0; i < dd.length; i++)
{
dd[i].style.display = "none";
}

function toggleSibling(e)
{
var i = matchNode(e.currentTarget);

if(i < 0)
{
return;
}

dd[i].style.display = (dd[i].style.display == "none") ? "" : "none";
}

function matchNode(obj)
{
for(var i = 0; i < dt.length; i++)
{
if(dt[i].isSameNode(obj))
{
return i;
}
}
return -1;
}
</script>
</body>
</html>It's up to you to get it working in IE.

techgearfree
01-31-2005, 05:13 AM
So does it not work well in IE? I know certain javascript has issues in IE. If it doesn't, then I probally wont even try.

Thanks

rgn1703
02-01-2005, 03:28 AM
Go to this link.

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

It is exactly what you are looking for and is cros-browser compatible.

Ron

techgearfree
02-01-2005, 04:01 AM
Thank You

techgearfree
02-03-2005, 11:05 PM
I am trying to use that website that rgn1703 kindly gave me. It is exactly what I want.

Now, I am trying to figure out how I go about this.

On my index page, I have the code in index.php (it is mainly code, I have another file for the appearance):



<?

$ipforcookie = $_SERVER['REMOTE_ADDR'];

if(! isset($_COOKIE['ipcookie']))
{
setcookie("ipcookie",$ipforcookie, time() +315569260);
}

$cookieip = $_COOKIE['ipcookie'];

define('IN_RAFS', true);
include "./sessions.php";
include 'includes/db.php';
include 'includes/mysql.php';
//include 'includes/templates.php';

$page = "Login";
$adsense = "no";
$logout = $_GET['logout'];

if ( $logout != NULL ) {
session_unset();
session_destroy();
setcookie("easyiuser", "");
setcookie("easyipass", "");
header("Location: index.php");
}

else {

// Make the database connection.
$db = new sql_db($dbhost, $dbuser, $dbpass, $dbname, false);
if(!$db->db_connect_id)
{
die("Could not connect to the database");
}
$cookie = $_GET['cookie'];
if ( $cookie == "yes" ) {
$username = $_COOKIE['easyiuser'];
$password = $_COOKIE['easyipass'];
$enpassword = $password;
}
else {
$username = $_POST['username'];
$password = $_POST['password'];
$enpassword = $password;
}
$cookiepass = ($enpassword);
$time = time();
$autologin = $_POST['autologin'];
if ($username != NULL && $password != NULL) {
include("includes/db.php");
$usercheck = mysql_query("SELECT * from users WHERE username='$username'and password='$enpassword'");
$useractive = mysql_query("SELECT * from users WHERE username='$username'and active='1'");
$usercorrect = mysql_fetch_array($usercheck);
$activeuser = mysql_fetch_array($useractive);
if ($usercorrect && $activeuser ) {
$_SESSION['username'] = $username;
if ( $autologin != NULL ) {
if ( $_COOKIE["easyiuser"] == NULL or $_COOKIE["easyipass"] == NULL ) {
setcookie("easyiuser", $username, time()+2592000);
setcookie("easyipass", $cookiepass, time()+2592000);
}
else {
}
}
else {
}
$theip = $_SERVER['REMOTE_ADDR'];
$logintime = "INSERT INTO logins SET
username = '$username',
login = Now(),
loginip = '$theip',
logincookieip = '$cookieip'";
mysql_query($logintime);
if ( $cookie != "yes" ) {
header("Location: index.php?sid=$sid");
}

else {
header("Location: index.php?sid=$sid");
}
}
elseif ( $usercorrect && $activeuser != "1" ) {
$message = "Your account is not active, please activate it via the e-mail you received.<br /><br />Click <a href=\"login.php\">here</a> to go back.";
include 'includes/header.php';
$tvars = array(
'message' => $message);
pparse('message_body');
}
else {
$message = "The username and password you entered are invalid.<br /><br />Click <a href=\"login.php\">here</a> to go back.";
include 'includes/header.php';
$tvars = array(
'message' => $message);
pparse('message_body');
}
}
else {
include 'includes/header.php';
pparse('login');
}
}
include 'includes/footer.php';
?>


Now, I have a template file called index.tpl :



<!-- Begin_switch_logged_out -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src="/images/select.gif"><FORM action="register.php" method="get">
<table width="100%" cellspacing="3" cellpadding="2" border="0">

<tr>
<td width="16%" class="choice">
<img src="/images/money.gif" border="0"><br />
$450 Check<br /><input type="radio" name="item" value="$450 Check">
</td>
</tr>
</table>
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<img src="../Application%20Data/Ipswitch/WS_FTP/Application%20Data/Ipswitch/WS_FTP/Storage/images/complete.gif">{REFERRAL_EMAIL}<br /><br />
Your E-Mail Address:
<input type="text" class="input" name="email" size="50"><br /><br />
<INPUT type=hidden value="{REFERRAL}" name=referral>
<input type="submit" class="input" value="Register"></form><br /><br />
</center>
</td>

<td width="10%">
</td>
</tr>
<!-- End_switch_logged_out -->

<!-- Begin_switch_logged_in -->
<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
<B>Welcome back to {SITE_TITLE}, {USERNAME}!<BR>
Below you can see your status for your free {PRODUCT}.</B>


</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
{USER_COMPLETED_OFFER}
</center>
</td>

<td width="10%">
</td>
</tr>

<tr>
<td colspan="3">
<br />
</td>
</tr>

<tr>
<td width="10%">
</td>

<td width="80%" class="box">
<center>
Referrals:<hr>{REFERRALS}

</center>
</td>

<td width="10%">
</td>
</tr>

<!-- End_switch_logged_in -->


I want the mouse over to work for this image:

http://www.techgearfree.com/images/money.gif

1.) Now, when I work with the the script on that page, I do not know whether to put it in the templete file, or the index.php

2.) I do not know how to make it pop up over the IMAGE because the site lets you put in a link and then the link will pop it up. I tried putting http://www.techgearfree.com/images/money.gif in, but it just gave me a link again.

I WOULD LOVE it if someone could help me. My aim scname is spetsacdc if anyone wants to talk on there, maybe I could get this worked out faster?.

Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum