1) Script Title: Image Thumbnail Viewer II
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...thumbnail2.htm
3) Describe problem: I would like to a link after the title text to open a popup with more info.
however although this is working on Firefox and IE the page faile the W3C Validator ad the code contains a nested link which is forbidden in XHTML. I understand that nested links can be used in HTML5 but I havent got my head around that yet!
I have prepared some test/demo pages:
The basic page which validates OK is:-
http://www.watermeadowstudio.co.uk/n...ew=&ex=&page=1
The page with the "info link" is:-
http://www.watermeadowstudio.co.uk/n...ew=&ex=&page=1
This lights up like a christmas tree on the W3C Validator
The original php code for the viewer dispaly is:-
The variable $info holds the link or is empty if there is no info data in the table.Code://Get LHS Thumbnail and Pic data $data = mysql_query("SELECT * FROM $tbl_name WHERE type='$type' LIMIT $start, $limit_col_1");} // Extract data from db table while($row = mysql_fetch_array($data)) { if ($row['PicNotes']) { $info = "<a href = \"notes/$row[PicNotes]\" class=\"popup1\"> <img src = \"images/info.png\"> </a>"; }else{ $info='';} // Display LHS Thumbnail and Viewer Pic Data echo "<a href='images/".$row['vfile']."' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>".$row['Title']."</b><br />".$row['Medium']." ".$row['iw']." x ".$row['ih']." cm.'><img border='1' src='images/".$row['tnfile']." ' alt=' ' title='' width='".$row['tnx']."' height='".$row['tny']."' class='tn' /></a><br />"; } echo "</td>"; // Viewer cell echo "<td width='41'></td> <td align='center' valign='top' width='640'> <div id='loadarea' class='viewer'><img src='images/wmlogo.gif' width='300' height='197' alt='' /><br /> Move the mouse over the thumbnails<br /> to view a larger image.</div> </td> <td width='41'></td> <td width='110' align='center' valign='top'>"; // Get RHS Thumbnail & Pic data $data = mysql_query("SELECT * FROM $tbl_name WHERE type='$type' LIMIT $start_col_2, $limit_col_2");} // Extract data from db table while($row = mysql_fetch_array($data)) { if ($row['PicNotes']) { $info = "<a href = \"notes/$row[PicNotes]\" class=\"popup1\"> <img src = \"images/info.png\"> </a>"; }else{ $info='';} // Display RHS Thumbnail and Viewer Pic Data echo "<a href='images/".$row['vfile']."' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>".$row['Title']."</b><br />".$row['Medium']." ".$row['iw']." x ".$row['ih']." cm.'><img border='1' src='images/".$row['tnfile']." ' alt=' ' width='".$row['tnx']."' height='".$row['tny']."' class='tn' /></a><br />"; } echo " </td> <td width='41'></td> </tr> </table>";
At this point $info has not been added to the title="..." statement.
in the second version of the page with the $info added, the viewer lines become:-
Maybe this is a blind alley. I looked at modifying the js script to add a second title statement in its own <a tag> but that is a little (lot!) beyond my abilities at present. Is there a simple solution or should I start learning HTML 5?Code:echo "<a href='images/".$row['vfile']."' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>".$row['Title']."</b><br />".$row['Medium']." ".$row['iw']." x ".$row['ih']." cm. $info'><img border='1' src='images/".$row['tnfile']." ' alt=' ' width='".$row['tnx']."' height='".$row['tny']."' class='tn' /></a><br />";



Reply With Quote

Bookmarks