|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've got a popup html page called june.html with an iframe called list, which contains anchors 01 - 30.
I'm using the following to open june.html, but cannot link to anchor 30, or any other anchors: Code:
<a href="events/june.html#30" target="list" onclick="NewWindow(this.href,'June','456','300','no','center');return false" class=event>30</a> The function for the above is as follows: Code:
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
Any help would be really appreciated, as this seems impossible.
__________________
::bluemoth:: |
|
#2
|
|||
|
|||
|
It is possible but you only mention the page loading into the popup window, what about the page loading into the Iframe?
|
|
#3
|
||||
|
||||
|
...return false prevents the #name positioning... maybe you must use:
<a href ="javascript:void(NewWindow('events/june.html#30','June','456','300','no','center');return true)" class=event>30</a> Note: remove the space between java and script (as this forum splits this word for unknown reasons )
|
|
#4
|
|||
|
|||
|
Thanks for the replies.
Quote:
I'm still having trouble doing this without the javascript though, so something is amiss with referencing. Quote:
You also mention "It is possible" . . . have you ever seen this been done? I'd be very grateful for 'confirmation' on this, as I have never come across this. Any help, or other suggestions are very much welcomed.
__________________
::bluemoth:: Last edited by ::bluemoth::; 07-01-2004 at 02:46 PM. |
|
#5
|
|||
|
|||
|
Are these anchors in june.html or the document in the iframe name list
|
|
#6
|
|||
|
|||
|
Pardon my lack of accurate detail . . . the anchors reside within an iframe called list, which itself resides within june.html - the NewWindow I'm calling.
__________________
::bluemoth:: |
|
#7
|
|||
|
|||
|
Take a look at the attached files to see if I am on the right track here
Open pop_main.htm and then select one of the links |
|
#8
|
|||
|
|||
|
Thanks Mr J.
Ineed that is exactly what I'm after. However, as you've illustrated, it needs help from javascript in order to actually work. But thank you very much for your help.
__________________
::bluemoth:: |
|
#9
|
|||
|
|||
|
Mr J, or anyone who knows how to do a very similar thing.
I have 2 iframes in one web page. I am trying to get the links from the left iframe to load a webpage into the right side iframe to a specific named anchor. It loads the webpage alright but it will not go to any anchors. However, if I refresh my browser, it then goes to the specified anchor. Left iframe code: Code:
<iframe frameborder="0" border="3" width="200" height="200" src="sites.htm" name="menu" scrolling="auto" MARGINWIDTH="5" MARGINHEIGHT="5" align="middle"; background-color="transparent" allowtransparency="true" style="filter:chroma (color=CCCCCC)"> </iframe> Code:
<iframe frameborder="1" border="4" width="200" height="300" src="thumbs.htm" name="thumbframe" id="tf1" scrolling="auto" MARGINWIDTH="5" MARGINHEIGHT="5" align="middle"; background-color="transparent" allowtransparency="true" style="filter:chroma (color=CCCCCC)"> </iframe> Code:
<a href="thumbs.htm#gx" target="thumbframe"> Code:
<a name="gx"></a> window.location.hash="#sample"; Code:
parent.document.getElementById('tf1').document.location.href = 'thumbs.htm#avs'";
<a href="javascript:parent.window.document.location.href = 'thumbs.htm#pop';" target="thumbframe">
<a href="javascript:parent.location.href = 'thumbs.htm#avs';" target="thumbframe">
<a href="javascript:parent.window.document.location.href = 'thumbs.htm#avs';>
<a href="thumbs.htm#" onClick="javascript:parent.window.location.reload();" target="thumbframe">
<a href="thumbs.htm#bossa" "javascript:parent.window.document.location.reload();" target="thumbframe">
<A HREF="javascript: void 0" ONCLICK="window.frames.thumbbox.location.href = 'thumbs.htm#avs'">
<a href="#"
onclick="parent.frames['thumbframe'].location.href =
'http://www.google.com/'; return false;">
<a href="javascript:changeFramePage('thumbframe','thumbs.htm#avs')">Load Yahoo</a>
<a href="#" onclick="parent.document.getElementById('tf1').document.location.href = 'thumbs.htm#avs"; return false;">
<A HREF="javascript: void 0" ONMOUSEOVER="window.frames.thumbframe.location.href = 'thumbs.htm#bossa'">
Thank you in advance. |
|
#10
|
|||
|
|||
|
Hello!
Mozilla does not show the behaviour you are having that problem with. In IE you might use a javascript workaround to overcome it. Put this script into the head section of your sites.htm: PHP Code:
<a href="thumbs.htm#gx" target="thumbframe" onmouseup="if(IE)scrollToAnchor(this.href.split('#')[1]);">goto gx</a> <a href="thumbs.htm#avs" target="thumbframe" onmouseup="if(IE)scrollToAnchor(this.href.split('#')[1]);">goto avs</a> etc.... The only other thing to do is to assign ids to the anchors in your thumbs.htm which are the same like their names. Example: <a name="gx" id="gx"></a> This will do the job (provided that js is available in the user's browser). If you have links which open a different file in which you also want to use this function it may become necessary to delay the execution of the function to avoid that it runs before the new iframe document has been fully loaded. Regards PJ
__________________
|
|
#11
|
|||
|
|||
|
PJ, you are a hero. Thank you so very much!
|
|
#12
|
|||
|
|||
|
Hi dubmecrazy!
You are very welcome. PJ
__________________
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|