Click to See Complete Forum and Search --> : URGENT: How to call ANCHORS within one LAYER from another LAYER?


Greenlander
06-10-2003, 10:05 AM
Hi everyone,

this is a HUGE problem for me and I haven't found any solution on the web so far and time is an issue... :(

This is what I want to do:

Within a frame, I have 2 layers (say A and B). Layer A has lots of text in it and the different paragraphs have HTML anchors. In another layer, I have a menu which also has a lot of items and both need to be able to scroll independently (hence the layer structure). Now I want to link from layer B's menu items to specific anchors in layer A.

That seemed pretty simple to me, but I couldn't find a way to address the other layer directly (by its ID of course). Then I tried to write a JS which is called from the menu items and then scrolls the content of the text layer. BUT: The scrollTo() method is only defined for the window object and not for the layer object or its layer.document (which I think is rather stupid since layers have autoscroll parameters, too)... :confused:

Does anybody have an idea how to accomplish this? Menu-Layer causes the content of a Text-Layer to scroll to a specific anchor??

Thanks a lot for any help!
GL

PS: just to make myself as clear as possible: I do NOT want to scroll the layer itself-- there are some nice scrolling effects that can be achieved this way, but in this case it would ruin my design.

Khalid Ali
06-10-2003, 11:05 AM
I might have not comprehend the question completely,just wondering how come you could not use

<a href="#internalAnchor">para 20</a>

something like above?

If I have totally not understood you then please post a link to you page.. to see it in action..

Greenlander
06-10-2003, 11:30 AM
Just 5 mins ago, I wrote that everything was OK-- :-) bull**** it wasn't. Thanks for your reply, Khalid-- my mistake was that I was thinking to complicated: I thought the content layer needed to be addressed by its ID. But since the anchors are defined on the same level as layers, I just needed the achor, period. Just like you said.

BUT: Now I've discovered another problem you could maybe help me with. I've uploaded the page here:
http://www.hinrichsen.com/!portfolio/en/10-content.htm

If you resize your browser widonw to a small height, you'll see 2 scrollbars: the first one (within the page) is for the content layer and the second one is for the window and would disappear if the page would be opened as a frame (which it will later). PROBLEM: in NETSCAPE 6, everything is fine. you click on the last menu item and the content layer scrolls WITHOUT scrolling the window itself (the right scrollbar doesn't change).. BUT: in IE5, not only the content layer scrolls but SO DOES THE WINDOW! :( ... as long this is a single window, this is just ugly. but as a frame with autoscrolling off, it becomes impossible to navigate!

how could i prevent IE5 from scrolling the f%$&ing window? :-)

gee, thanks for reading this. i hope it gets clearer with the link and the sourcecode...

cheers,
GL

Greenlander
06-10-2003, 12:28 PM
just in case you don't get an auto-notification for edited posts... sorry

Khalid Ali
06-10-2003, 07:56 PM
I am using NS6+ and IE6+ browsers..
interestingly I am not having any of the problems you mentioned....

Greenlander
06-10-2003, 08:41 PM
That is unfortunate (for me)... Well, I asked a friend to test the same page and he experienced the same problem as I did. :(

Well, just in case I wanted to use a JS function to (a) scroll the content layer to a specific anchor (instead of just calling it by HREF) and then (b) reset the window scroll to (0,0) so that visitors wouldn't notice the "dual" scroll described above-- how would you do that?

I'm usually designing/scripting with Flash/AS and really have little knowledge of JS, so I's be grateful for your suggestions! :-)

Thanks,
GL