473,657 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onclick with anchor link

93 New Member
Hi

How can I make the anchor link once I do onclick?

[HTML]

<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff0 0" onMouseOver="th is.style.backgr ound ='red'"
onMouseOut="thi s.style.backgro und='#00ff00'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.resetNotes() ;"></td>

[/HTML]

Below is link file MB2eventlistTim eline.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.dt d">
<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="moviebrow ser2.css" type="text/css" title="Default" media="screen"/>
</head>

<body bgcolor="#72625 7" background="ifr ame-background.jpg" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0 " marginwidth="0" marginheight="0 " style="width:26 0px;overflow:hi dden;">
<table width="270" border="0" cellspacing="0" cellpadding="0" >

<?php

function insertEventTabl eRow($movieID, $eventID, $keyFrame, $startTime, $stopTime, $eventInformati on) {
?>
<tr bgcolor="#72625 7" onMouseOver="th is.bgColor='#53 4741';" onMouseOut="thi s.bgColor='#726 257';" 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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.resetNotes() ;">
</td>
<td width="195" class="eventEnt ryText" onclick="parent .playClip(<?php echo $eventID?>, <?php echo $startTime;?>, <?php echo $stopTime;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.resetNotes() ;">
<?php echo $eventInformati on?>
</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("INSER T INTO LogsTable (page, action, userID, type, date) VALUES ('timeline', '$events categories', " . $_SESSION['user']->userID . ", '', getDate())");

$allEvents = $db->get_results("S ELECT * FROM EventsShotsStar tAndStopFrames where movieID='$movie ID' and eventCategory = '$events' order by eventNo");

foreach($allEve nts as $event)
{

$shotStartTime = $event->shotStartFra me/29.97;

if(is_int($even t->shotStartFrame )) {
$shotStopTime = $event->shotStopFram e/29.97;
}
else {
$shotStopTime = 0;
}

$numberOfShotsI nEvent = $event->endShot - $event->startShot;
$eventInformati on = "<b>$events " . $event->eventNo . "</b><br />($numberOfShot sInEvent shots)<br />";
$eventInformati on .= '<em style="font-size:smaller;"> ' . sec2hms($shotSt artTime) . " - " . sec2hms($shotSt opTime).'</em>';

//insertEventTabl eRow($movieID, $event->eventID, $event->imgSelectedKey frm, $shotStartTime, $shotStopTime, $eventInformati on);
insertEventTabl eRow($_GET['movieID'], $event->eventID, $event->imgSelectedKey frm, $shotStartTime, $shotStopTime, $eventInformati on);
}
break;
default:
die("Invalid Event!");
break;
}

?>

</table>
</body>
</html>


[/HTML]
Feb 9 '08 #1
11 4058
acoder
16,027 Recognized Expert Moderator MVP
Use <a name="#somethin g"> where you want to link to and then link to that when changing the location, e.g. MB2eventlistTim eline.php?...#s omething.
Feb 11 '08 #2
nma
93 New Member
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="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'"
onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.resetNotes() ; name="<?php echo $eventID?>";">

[/PHP]
Feb 28 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
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 New Member
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="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'"
onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>#eventID'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.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 Recognized Expert Top Contributor
I think you are missing two things.

1. I couldn't find anything like <a name="anchor_na me"></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 New Member
I think you are missing two things.

1. I couldn't find anything like <a name="anchor_na me"></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="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'"
onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>#eventID'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.resetNotes() ;" style="cursor: pointer;"></td>
[/PHP]
view source
<td width="7" height="17" bgcolor="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'"
onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=1&events=Mo ntage#eventID'; parent.playClip (25, 3185.55221889, 3234.43443443); parent.notesFor m.eventID.value =25;parent.rese tNotes();" 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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.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.notesFor m.eventID.value =23;parent.rese tNotes();"><a name="eventID"> </a>
Feb 29 '08 #7
hsriat
1,654 Recognized Expert Top Contributor
Try this...[php]<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'" onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>#<?php echo $timeline->eventID?>'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.resetNotes() ;">
[/php]
Feb 29 '08 #8
nma
93 New Member
Try this...[php]<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFA29 C" onMouseOver="th is.style.backgr ound ='red'" onMouseOut="thi s.style.backgro und='#FFA29C'" onClick="window .frames.eventsD isplay.location = 'MB2eventlistTi meline.php?movi eID=<?php echo $movie->movieID;?>&eve nts=<?php echo $timeline->eventCategory; ?>#<?php echo $timeline->eventID?>'; parent.playClip (<?php echo $timeline->eventID?>, <?php echo $shotStartTime? >, <?php echo $shotStopTime?> );parent.notesF orm.eventID.val ue=<?php echo $timeline->eventID?>;pare nt.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;?>);p arent.notesForm .eventID.value= <?php echo $eventID?>;pare nt.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 Recognized Expert Top Contributor
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

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

Similar topics

1
1581
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 people enter their credit card info on an ecommerce site. This is the first such site (Shopping Cart) I have done and this code was provded by a user of the standard ASP Shopping Cart software (CandyPress shopping cart.) It works, but I don't...
2
1644
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 people enter their credit card info on an ecommerce site. This is the first such site (Shopping Cart) I have done and this code was provded by a user of the standard ASP Shopping Cart software (CandyPress shopping cart.) It works, but I don't...
4
16417
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 onClick event to call a script and pass the href URL and link text? That is; We'd like to put an identical piece of JS code into each
53
81709
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> Clicking on the first list item gives me "link1" because "this" refers
18
7433
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) with just a #, then it works in IE. wtf? Any help.
13
2523
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 window.location.href to include the #. FF does. (eg) <a href="#moo" onclick="alert('moo'); return false;"> After clicking in IE, location bar in browser shows "www.moo.cow/index.htm". After clicking in FF, location bar in browser shows
11
3005
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. It works perfectly (assigning the correct images and the correct onclick events to the correct <atags):
9
3224
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 even if display is set to block. it only look changes when there is a href there. but if i have a href there then when i click it will load the page, which i dont want. how can i get the anchor to look like a proper link where the users pointer...
8
1566
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 results in a "hi" but no change in location, the link isn't followed because onclick returned false. Now look at what I thought was the same thing:
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.