473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

onclick with anchor link

93
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]
Feb 9 '08 #1
11 4022
acoder
16,027 Expert Mod 8TB
Use <a name="#something"> where you want to link to and then link to that when changing the location, e.g. MB2eventlistTimeline.php?...#something.
Feb 11 '08 #2
nma
93
Hi Again
I still could not solve this problem.. below is the code..
the anchor name is #eventID,
It does not show correct disply. It display by default from the first list.

Please help.

nma

[PHP]
<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'"
onMouseOut="this.style.background='#FFA29C'" 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();" style="cursor: pointer; "#<?php echo $timeline->eventID?>" "></td>


[/PHP]




[PHP]
<img style="border: solid 1px; border-color:#00ff00 " 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(); name="<?php echo $eventID?>";">

[/PHP]
Feb 28 '08 #3
acoder
16,027 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#eventID';
Feb 28 '08 #4
nma
93
Expand|Select|Wrap|Line Numbers
  1. onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#eventID';

[PHP]

<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'"
onMouseOut="this.style.background='#FFA29C'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#eventID'; parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();" style="cursor: pointer;"></td>

[/PHP]


[PHP]
<img style="border: solid 1px; border-color:#FFA29C" 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(); name="<?php echo $eventID?>";">

[/PHP]

When I want to give anchor name based on eventID eg 17 and display will start at number 17
I do like above no error but display still from beginning. Where is went wrong?

Thanks
Feb 29 '08 #5
hsriat
1,654 Expert 1GB
I think you are missing two things.

1. I couldn't find anything like <a name="anchor_name"></a> in your code.
2. Anchor, which you are referring to is eventID, but not its value.


Please do the following:

1. Open your page in browser >> right click on the page >> click on view source >> copy the HTML source and post it here.
2. Also tell me what do you see in the address bar when you click on the link. Do post that address here.
Feb 29 '08 #6
nma
93
I think you are missing two things.

1. I couldn't find anything like <a name="anchor_name"></a> in your code.
2. Anchor, which you are referring to is eventID, but not its value.


Please do the following:

1. Open your page in browser >> right click on the page >> click on view source >> copy the HTML source and post it here.
2. Also tell me what do you see in the address bar when you click on the link. Do post that address here.



[PHP]
<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'"
onMouseOut="this.style.background='#FFA29C'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#eventID'; parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();" style="cursor: pointer;"></td>
[/PHP]
view source
<td width="7" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'"
onMouseOut="this.style.background='#FFA29C'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=1&events=Montage #eventID'; parent.playClip(25, 3185.55221889, 3234.43443443);parent.notesForm.eventID.value=25;p arent.resetNotes();" style="cursor: pointer;"></td>
[PHP]

<img style="border: solid 1px; border-color:#FFA29C" 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();"><a name="eventID"></a>
[/PHP]
view source...
<img style="border: solid 1px; border-color:#FFA29C" src="../moviebrowser/shrek/61212.jpg"
onclick="parent.playClip(23, 2033.56690023, 2059.95995996);parent.notesForm.eventID.value=23;p arent.resetNotes();"><a name="eventID"></a>
Feb 29 '08 #7
hsriat
1,654 Expert 1GB
Try this...[php]<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'" onMouseOut="this.style.background='#FFA29C'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#<?php echo $timeline->eventID?>'; parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();" style="cursor: pointer;"></td>
[/php]
[php]
<a name="<?php echo $eventID?>"></a>
<img style="border: solid 1px; border-color:#FFA29C" 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();">
[/php]
Feb 29 '08 #8
nma
93
Try this...[php]<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29C" onMouseOver="this.style.background ='red'" onMouseOut="this.style.background='#FFA29C'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>#<?php echo $timeline->eventID?>'; parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();" style="cursor: pointer;"></td>
[/php]
[php]
<a name="<?php echo $eventID?>"></a>
<img style="border: solid 1px; border-color:#FFA29C" 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();">
[/php]
Hi HSRIAT

It works..I can do the anchor link now...but again how do I make it at the same time hightlighted at the current position?

Many thanks :)

nma
Mar 3 '08 #9
hsriat
1,654 Expert 1GB
Hi HSRIAT

It works..I can do the anchor link now...but again how do I make it at the same time hightlighted at the current position?

Many thanks :)

nma
high-lightened? What do you want to high-lighten? I didn't get you.
Mar 3 '08 #10
nma
93
high-lightened? What do you want to high-lighten? I didn't get you.
..means the current position(anchor link) also change the color eg the background color
Mar 3 '08 #11
hsriat
1,654 Expert 1GB
..means the current position(anchor link) also change the color eg the background color
Then on the click event of the button, you can also add js code to change background color.
Look at this
Mar 3 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Will | last post by:
(My 4 questins at end after explination) The code below was provided to me to "Popup" a window explaining what a Credit Card Verification Number is and where to find it on a card... it is used as...
2
by: Will | last post by:
(My 4 questins at end after explination) The code below was provided to me to "Popup" a window explaining what a Credit Card Verification Number is and where to find it on a card... it is used as...
4
by: Jerry Sievers | last post by:
JS Programmers, "I'm a server-side coder PHP, Postgres etc... My question; Given the following anchor <a href="http://www.somesite.com/somefile.html">link text</a> Is there a way to code an...
53
by: usenet | last post by:
See <ul> <li><a name="link1" onClick="alert(this.name);return false;" href="#">Link1</a></li> <li><a name="link2" href="javascript:alert(this);">Link2</a></li> <li>Item 3</li> </ul> ...
18
by: seth.m.green | last post by:
<a href="javascript: void(0);" onclick="window.location.href='/foo.bar?one=false&two=true'">Link</a> works like a charm in Firefox. I get NOTHING in IE. but if I replace the javascript: void(0)...
13
by: Logos | last post by:
There seems to be a serious difference between how FF an IE handle an anchor with an href containing a # and an onclick event. If the onclick event returns false, IE does not change...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
9
by: monomaniac21 | last post by:
hi all i want to use hyperlinks to 'load' content by changing the display of div tags. the problem i have is that unless i specify a href the anchor does not change the mouse pointer on hover...
8
by: hobosalesman | last post by:
Consider the following (where 'a' is an anchor element with a valid URL href): a.onclick=help_mode; function help_mode() { alert("hi"); return false; } As expected clicking on the link now...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.