Click to See Complete Forum and Search --> : change visibility of layer from link on included page
stiga
01-15-2003, 10:13 AM
case 1: I want to change visibility on a layer on a page but the problem is that i have to call the action from a page that is included into the page where the layer is. the thing that messes it all up is that the included page is included into an iframe and i can't figure out how to get the "show" request sent to the page where the layer is located.
case 2: right now i have tried to place the layer in the page included into the iframe but when i do that it won't show more of the layer than the size of the iframe and the layer content is larger than that.
to my questions:
case 1: how do i change visibility on a layer with code from another page than the page with the layer on?
case 2: how do i get the layer to show on top of the iframe that the page with the layer is included into?
link to case 2: http://www.prippa.com/prippa03/mall_2.cfm
click the magnifier and youll understand the problem in case 2.
:confused:
gil davis
01-15-2003, 10:30 AM
Originally posted by stiga
case 1: how do i change visibility on a layer with code from another page than the page with the layer on?That depends on the relationship between the pages. If you know the name (target) of the window/frame, you can use window.open() to create a pointer and thus point to the layer. This is probably the easiest way to do it.
1. Establish the window's name in the "parent" window, e.g.:
window.name="topWin";
2. Establish a link from the page inside the iframe, e.g.:
topWin = window.open("","topWin");
3. go from there...
case 2: how do i get the layer to show on top of the iframe that the page with the layer is included into?
You cannot make an object larger than it's containing window (in your case, the iframe).
stiga
01-15-2003, 01:21 PM
1. Establish the window's name in the "parent" window, e.g.: window.name="topWin";
is the "window's name" the name of the layer that i want to change visibility on?
2. Establish a link from the page inside the iframe, e.g.: topWin = window.open("","topWin");
hm...i just realized that i don't know much about scripting...how do i add this code to the link (the magnifier image in the example) that is supposed to open the layer with the code @ #1?
still confused :confused:
gil davis
01-15-2003, 01:38 PM
I answered your questions the best I could, in a general way, because I looked at your page and could not tell what you expected the magnifier to do.is the "window's name" the name of the layer that i want to change visibility on?No. It is the name of the window that contains the layer that you want to change visibility.
Your problem seems to be that you really only have one document. You have two "layers" that have "Layer1" as their ID, and that is not valid. An ID must be unique.
stiga
01-16-2003, 01:14 AM
:(
ok, the thing i want the magnifier to do is to show a "full size" image of the current b&w picture (the black and white picture is just a part of a larger one) that is currently showing. in other words i want the magnifier to change visibility to "show" on the specific layer containing the full size image.
the layer (actually two different right now "ceorebrofull" and "cecarlstownfull" but it's the one called "ceorebrofull" that should be turned on and off with the magnifier right now) is located on this page (http://www.prippa.com/prippa03/inc_cont_mall.cfm) and the magnifier that should controll it all is on this page (http://www.prippa.com/prippa03/ceorebro.cfm).
Your problem seems to be that you really only have one document. yes and no. as you allready have noticed, i guess, i have in this case 3 different documents (mall_2.cfm, inc_cont_mall.cfm and ceorebro.cfm) but only one window since i don't want to show the full size image in a pop-up window, which, if i did, should give me two different and unique windows - am i getting it right here?
:confused: