LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2009, 08:36 PM   #1
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
javascript mouseover problem


the following code is a snippet of a php script for a link that when clicked, loads a javascript routine that loads the picture in
Code:
echo "<td><a href=\"files/".$picture_name."-".$pic_number.".jpg\" rel=\"transition[appear]\" ><img height=\"100\" src=\"files/".$picture_name."-".$pic_number."t.jpg\"/></a></td>";
whenever i put the standard 'follow link' it always loads the image in a separate window
what i need to do is make sure the rel= part is obeyed on mouseover as well, it works when clicked and the mouseover part is omitted
this is the entire php script (minus the js files)
Code:
<?PHP 

if (arg(0) == 'node' or arg(0) == 'print'){$node = node_load(intval(arg(1)));
$num_pictures=$node->field_photos[0]['value'];
$picture_name=$node->field_vin[0]['value'];
}
if ($picture_name=="array"){} else {

$picnum = preg_replace('/[^0-9\s]/', '', $num_pictures);

$patha= substr($picture_name,13,2);
$pathb= substr($picture_name,15,2);
$pic_number=1;

echo  "<head><script>

/*
Script by JavaScript Kit
(http://javascriptkit.com)
Over 400+ free original scripts here
*/


function loadfollow(which){
if (!window.win2||win2.closed)
win2=window.open(which.href)
else
win2.location=which.href
}
</script><script type=\"text/javascript\" src=\"files/includes/scrollDiv.js\"></script><script type=\"text/javascript\" src=\"files/transition_js/prototype.js\"></script><script type=\"text/javascript\" src=\"files/transition_js/scriptaculous.js?load=effects\"></script><script type=\"text/javascript\" src=\"files/transition_js/transition.js\"></script>
</head><table  width=100%><tr><td width=20%></td><td align=right><div id = \"rightCol\">
			<div id=\"holder\" style=\"border: 5px solid #999; width: 640px; height: 480px;float:left\">
				<img src=\"files/".$picture_name."-".$pic_number.".jpg\" />
			</div>
</td></tr><tr>";
echo  "<td></td><td align=right><table width=630px><tr><td><a href=\"#null\" onmouseover=\"scrollDivRight('scroll')\" onmouseout=\"stopMe()\"><img src=\"http://pictures.gotdns.org/arrow_left.gif\"></img></a></td><td align=center><div id=\"scroll\" style=\"width:570px;overflow:hidden;\"><table><tr>";
for ($pic_number=1;$pic_number<=$picnum;$pic_number++) {
if (!file_exists("files/".$picture_name."-".$pic_number.".jpg")) {
$picture=file_get_contents("http://imgs.getauto.com/imgs/ag/ga/".$patha."/".$pathb."/".$pic_number."/".$picture_name."-".$pic_number.".jpg");
$destination=fopen("files/".$picture_name."-".$pic_number.".jpg",'wb');
fwrite($destination,$picture);
//fclose($picture);
fclose($destination);
}
if (!file_exists("files/".$picture_name."-".$pic_number."t.jpg")) {
$picture=file_get_contents("http://imgs.getauto.com/imgs/ag/ga/".$patha."/".$pathb."/".$pic_number."t/".$picture_name."-".$pic_number."t.jpg");
$destination=fopen("files/".$picture_name."-".$pic_number."t.jpg",'wb');
fwrite($destination,$picture);
fclose($destination);
}
echo "<td><a href=\"files/".$picture_name."-".$pic_number.".jpg\" rel=\"transition[appear]\" ><img height=\"100\" src=\"files/".$picture_name."-".$pic_number."t.jpg\"/></a></td>";

}
echo "</tr></table></div></td><td><a href=\"#null\" onmouseover=\"scrollDivLeft('scroll')\" onmouseout=\"stopMe()\"><img src=\"http://pictures.gotdns.org/arrow_right.gif\"></img></a></td></tr></table></td></tr></table><script type=\"text/javascript\">
oTransition = new Transition( 'holder', 'files/".$picture_name."-1.jpg');
</script> ";
}
?>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouseover desktop icons is not working? Paulius Linux - Newbie 4 02-07-2008 06:58 PM
javascript problem with IE alitrix Programming 9 05-31-2006 10:14 PM
removing mouseover effect MaTrIx709 Linux - General 1 03-28-2006 12:03 PM
Java/Javascript problem????? Jadewolf Linux - Software 2 10-25-2003 07:06 PM
Elinks: javascript problem ashesh Linux - General 1 07-21-2003 02:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration