onclick with anchor link [英] onclick with anchor link
问题描述
嗨
一旦我点击,我怎样才能建立锚链接?
[HTML]
>
< td width ="<?php echo($ cellwidth); ?>"高度= QUOT; 17" BGCOLOR = QUOT;#00FF00" onMouseOver =" this.style.background =''red''"
onMouseOut =" this.style.background =''#00ff00''" onClick =" window.frames.eventsDisplay.location =''MB2eventlistTimeline.php?movieID =<?php echo $ movie-> movieID;?>& events =<?php echo $ timeline-> eventCategory ;?> ''; parent.playClip(<?php echo $ timeline-> eventID?>,<?php echo $ shotStartTime?>,<?php echo $ shotStopTime?>); parent.notesForm.eventID.value = < ;? php echo $ timeline-> eventID?> ;; parent.resetNotes();">< / td>
[/ HTML]
以下是链接文件MB2eventlistTimeline.php。我希望它在不使用滚动条的情况下在开始列表中显示结果。目前,它列出了iframe中的整个文件。我希望它根据它发送的变量转到iframe显示中的特定点,或者如果可能的话突出显示当前位置
[HTML]
<! DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns =" http://www.w3.org / 1999 / xhtml">
< head>
< meta http-equiv =" Content-Type"含量=" text / html的;字符集= ISO-8859-1" />
< title>浏览 - 搜索注释电影< / title>
< link rel =" stylesheet" HREF =" moviebrowser2.css"类型= QUOT;文本/ CSS"标题= QUOT;默认" media =" screen" />
< / head>
< body bgcolor ="#726257"背景= QUOT; iframe的background.jpg" LEFTMARGIN = QUOT; 0" TOPMARGIN = QUOT; 0" rightmargin = QUOT; 0" bottommargin = QUOT; 0" MARGINWIDTH =" 0" MARGINHEIGHT =" 0" style =" width:260px; overflow:hidden;">
< table width =" 270"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0">
<?php
函数insertEventTableRow($ movieID,$ eventID,$ keyFrame,$ startTime ,$ stopTime,$ eventInformation){
?>
< tr bgcolor ="#726257"的onMouseOver = QUOT; this.bgColor =#534741’ ;"的onmouseout = QUOT; this.bgColor =#726257’ ;" style =" cursor:pointer;">
< td width =" 65" VALIGN = QUOT;顶"宽度= QUOT; 65 QUOT;高度= QUOT; 44"边界=" 1 QUOT; vspace =" 2">
< img src ="<?php echo $ keyFrame;?>"
onclick =" parent.playClip(<?php echo $ eventID?>,<?php echo $ startTime;?>,<?php echo $ stopTime;?> ); parent.notesForm.eventID.value =<?php echo $ eventID?> ;; parent.resetNotes();">
< / td>
< td width =" 195"类= QUOT; eventEntryText" onclick =" parent.playClip(<?php echo $ eventID?>,<?php echo $ startTime;?>,<?php echo $ stopTime;?>); parent.notesForm.eventID。 value =<?php echo $ eventID?> ;; parent.resetNotes();">
<?php echo $ eventInformation?>
< ; / TD>
< / tr>
< tr>
< td colspan =" 2" height =" 5">
< img src =" iframe-borderline.jpg"宽度= QUOT; 230" height =" 5" />
< / td>
< / tr>
<?php
}
$ events =(isset($ _ GET [''events'']))?$ _ GET [''events'']:All ; //只需拨打一次电话即可。无需像$ movieID一样定义线路
开关($ events){
case" All":
休息;
case" Dialogue":
case" Montage":
case" Exciting" :
$ db->查询(&INSAND INTO LogsTable(页面,动作,用户ID,类型,日期)VALUES(''timeline'',''$ events categories' ',"。$ _SESSION [''user''] - > userID。",'''',getDate())");
$ allEvents = $ db-> get_results(" SELECT * FROM EventsShotsStartAndStopFrames where movieID =''$ movieID''和eventCategory =''$ events''order by eventNo");
foreach ($ allEvents as $ event)
{
$ shotStartTime = $ event-> shotStartFrame / 29.97;
if(is_int($ event-> shotStartFrame)){
$ shotStopTime = $ event-> shotStopFrame / 29.97;
}
else {
$ shotStopTime = 0;
}
$ numberOfShotsInEvent = $ event-> endShot - $ event-> startShot;
$ eventInformation ="< b> $ events" 。 $ event-> eventNo。 "< / b>< br />($ numberOfShotsInEvent shot)< br />" ;;
$ eventInformation。=''< em style =" font-尺寸:较小;">''。 sec2hms($ shotStartTime)。 " - 。 sec2hms($ shotStopTime)。''< / em>'';
// insertEventTableRow($ movieID,$ event-> eventID,$ event-> imgSelectedKeyfrm,$ shotStartTime,$ shotStopTime,$ eventInformation);
insertEventTableRow($ _ GET [''movieID''],$ event-> eventID,$ event-> imgSelectedKeyfrm,$ shotStartTime,$ shotStopTime,$ eventInformation);
}
休息;
默认:
die(无效事件!) ;
休息;
}
?>
< /表>
< / body>
< / html>
[/ HTML]
Hi
How can I make the anchor link once I do onclick?
[HTML]
<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background =''red''"
onMouseOut="this.style.background=''#00ff00''" onClick="window.frames.eventsDisplay.location = ''MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>''; parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();"></td>
[/HTML]
Below is link file MB2eventlistTimeline.php. I want it to display the result at the beginning list without using the scrolbar. Currently it list the whole file in the iframe. I want it to go to specific point in the iframe display according to the variable it sent or if possible highlighted current location
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Browse-Search-Note Movies</title>
<link rel="stylesheet" href="moviebrowser2.css" type="text/css" title="Default" media="screen"/>
</head>
<body bgcolor="#726257" background="iframe-background.jpg" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" style="width:260px;overflow:hidden;">
<table width="270" border="0" cellspacing="0" cellpadding="0">
<?php
function insertEventTableRow($movieID, $eventID, $keyFrame, $startTime, $stopTime, $eventInformation) {
?>
<tr bgcolor="#726257" onMouseOver="this.bgColor=''#534741'';" onMouseOut="this.bgColor=''#726257'';" style="cursor: pointer;">
<td width="65" valign="top" width="65" height="44" border="1" vspace="2">
<img src="<?php echo $keyFrame;?>"
onclick="parent.playClip(<?php echo $eventID?>, <?php echo $startTime;?>, <?php echo $stopTime;?>);parent.notesForm.eventID.value=<?php echo $eventID?>;parent.resetNotes();">
</td>
<td width="195" class="eventEntryText" onclick="parent.playClip(<?php echo $eventID?>, <?php echo $startTime;?>, <?php echo $stopTime;?>);parent.notesForm.eventID.value=<?php echo $eventID?>;parent.resetNotes();">
<?php echo $eventInformation?>
</td>
</tr>
<tr>
<td colspan="2" height="5">
<img src="iframe-borderline.jpg" width="230" height="5"/>
</td>
</tr>
<?php
}
$events = (isset($_GET[''events'']))?$_GET[''events'']:"All"; //just call one time only..no need to defin on top of the line like $movieID
switch($events) {
case "All":
break;
case "Dialogue":
case "Montage":
case "Exciting":
$db->query("INSERT INTO LogsTable (page, action, userID, type, date) VALUES (''timeline'', ''$events categories'', " . $_SESSION[''user'']->userID . ", '''', getDate())");
$allEvents = $db->get_results("SELECT * FROM EventsShotsStartAndStopFrames where movieID=''$movieID'' and eventCategory = ''$events'' order by eventNo");
foreach($allEvents as $event)
{
$shotStartTime = $event->shotStartFrame/29.97;
if(is_int($event->shotStartFrame)) {
$shotStopTime = $event->shotStopFrame/29.97;
}
else {
$shotStopTime = 0;
}
$numberOfShotsInEvent = $event->endShot - $event->startShot;
$eventInformation = "<b>$events " . $event->eventNo . "</b><br />($numberOfShotsInEvent shots)<br />";
$eventInformation .= ''<em style="font-size:smaller;">'' . sec2hms($shotStartTime) . " - " . sec2hms($shotStopTime).''</em>'';
//insertEventTableRow($movieID, $event->eventID, $event->imgSelectedKeyfrm, $shotStartTime, $shotStopTime, $eventInformation);
insertEventTableRow($_GET[''movieID''], $event->eventID, $event->imgSelectedKeyfrm, $shotStartTime, $shotStopTime, $eventInformation);
}
break;
default:
die("Invalid Event!");
break;
}
?>
</table>
</body>
</html>
[/HTML]
推荐答案
cellwidth); ?>"高度= QUOT; 17" BGCOLOR = QUOT;#00FF00" onMouseOver =" this.style.background =''red''"
onMouseOut =" this.style.background =''#00ff00''" onClick =" window.frames.eventsDisplay.location =''MB2eventlistTimeline.php?movieID =<?php echo
cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background =''red''"
onMouseOut="this.style.background=''#00ff00''" onClick="window.frames.eventsDisplay.location = ''MB2eventlistTimeline.php?movieID=<?php echo
movie-> movieID;?>& events =< ;?php echo
movie->movieID;?>&events=<?php echo
timeline-> eventCategory;?>''; parent.playClip(<?php echo
timeline->eventCategory;?>''; parent.playClip(<?php echo
这篇关于onclick with anchor link的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!