Click to See Complete Forum and Search --> : Anchors


theyulia
02-16-2004, 06:10 PM
Hello,

Is there any way to make something with JavaScript that will work as HTML anchors (jump to the particular page section after user clicks on the link - say, for FAQs page)?

Thanks a lot for your help!

Regards,
Yulia

Vladdy
02-16-2004, 06:13 PM
But that is what anchor is for, no reason to use javascript.

<a href="#target">jump to target</a>
....
<dt id="#target">This is target</dt>

theyulia
02-16-2004, 06:22 PM
HTML anchors do not work on Oracle's new portal sites. Thanks for your help.

Vladdy
02-16-2004, 07:11 PM
I don't know what are "Oracle's new portal sites" but if "HTML anchors do not work" in them, they better fix their HTML.

theyulia
02-16-2004, 07:33 PM
Vladdy,

I've created this topic hoping that maybe somebody can quickly help me with my question. Recommendations for Oracle folks what they need to do with their tools won't help me, really ;)

FYI - Oracle Application Server Portal (http://portalcenter.oracle.com).

From their FAQ page:

Q: Do bookmark anchors work in Portal?
A: No. Named anchors (bookmarks) are not recognized within a Portal page, so linking to them from either the same page or from other pages will not work.

Thanks again for your time.

Vladdy
02-16-2004, 07:36 PM
If you posted a link to a page you are working on, explained how you use this Oracle portal page (in an iframe or it is generated as part of server side code), how you plan to tap into it, you may get more than a generic answer.

theyulia
02-16-2004, 07:46 PM
It's just a simple FAQ page (something like this one (http://www.hwg.org/resources/faqs/cssFAQ.html)) with the list of questions on the top of the page and detailed answers below. Portal recognizes all html tags but anchors.

Vladdy
02-16-2004, 08:00 PM
In order to scroll to a certain element using javascript, you need to identify this element. However if you can identify this element (using id attribute) then you can use <a href="#elementID">
- catch 22

If you can use javascript to parse the code and identify the target elements by some string comparisons - then it would be easier to dynamically add the id attribute to this element and still use <a href="#elementID"> than mess with determining element position and scrolling to it.