3 replies [Last post]
mickieluv
Offline
Regular
Last seen: 16 years 4 days ago
Joined: 2004-07-09
Posts: 20
Points: 0

**edit - dont bother reading this, its very long and boring... see my reply below**

Hello all, take a seat... you may be here some time!

Ive struggled with this for hours last night and still can't fix it... It’s the only remaining problem with this current verison of my website code.

this is the site im talking about :
http://www.madewithpixels.co.uk

ok here goes.

There seems to be a problem with the javascript links opening the folio navigation in a new window rather than replacing the frames. It only happens when the user clicks into the portfolio section using the news item links from the home page.... To better explain it, try the following...

in the folio section of my website, im using the following piece of code to load 3 frames in a frameset called folio.html:

<a href="#" onclick="window.open('10associates_frame1.html','10associates_frame1');window.open('10associates_frame2.html' ,'10associates_frame2');window.open('10associates_frame3.html', '10associates_frame3');"> 10associates link </a>

for example 1 see http://www.madewithpixels.co.uk and navigate to folio > world wide web > 10associates - the last click is the place the code example above is executed. and as you'll see theres nothing wrong here, it works a-ok, the correct folio content pages load in their correct frames...

however, if i use a different piece of code to navigate to a simliar frameset then when the main folio links are clicked, they do not open in the frames, but in seperate windows.

so, this new, example 2 code (which is a link made from a cell) is:

<tr>
<td colspan="4" class="news_body"
onClick="window.open('folio_www_supe_sc.html','_parent');"
onmouseover="this.style.backgroundColor='#FF00FF'; this.style.cursor='hand'; this.style.color='#FFFFFF';"
onmouseout="this.style.backgroundColor='#7C8088'; this.style.color='#CCCCCC';"> link text </td>
</tr>

this takes you to a new frameset that contains the code (same as example 1) but the code in example 1 now does not work correctly - to see this working goto http://www.madewithpixels.co.uk and click the '10associates is completed' button on the news section, then click the 'printed media' button to see what i mean.

(note: as i mentioned, using the 'news link' does not take you to the same folio.html as before, but to a seperate file called folio_10associates.html)

im pretty sure its the window.open command in the first piece of code that is causing the problem, it cant be that theres something different about folio.html and folio_10associates.html as they contain exactly the same frames.

to make matters worse, the Opera browser seems to behave like the 2nd example all the time, opening ALL the folio links in a seperate window no matter which way you navigate into the folio section...

im thinking that this 'Opera' issue is telling me something and that im using the wrong syntax for the folio links. should i be using
window.location.href?
or
parent.location.href?
or
parent.frame.location.href?

its driving me insane! does anyone have any idea whats going on?

cheers v much for any help

Mike

www.madewithpixels.co.uk
design | graphics | multimedia

Tags:
mickieluv
Offline
Regular
Last seen: 16 years 4 days ago
Joined: 2004-07-09
Posts: 20
Points: 0

frameset javascript syntax - multiple targets problems

after playing around for an hour, heres the short version of what i'm trying to achieve...

can anyone tell me if theres a different syntax for loading multiple frames from a cell made into a link with the OnClick command, other than the following code...

<tr>
<td onclick="window.open('frame1.html','frame1'); window.open('frame2.html', 'frame2');"
onmouseover="this.style.backgroundColor='#FF00FF';this.style.cursor='hand'; this.style.color='#FFFFFF';" > text label </td>
</tr>

In opera, this code forces all the links to open in seperate tabs/windows rather than loading them into the proper frames.
im thinking that i should be using something like:

onClick="parent.frame1.location.href="frame1.html";

but i dont know if this is correct (i cant get it to work anyway) and i dont know how to add multiple targets to it either

cheers very much for any help, this is really frustrating me now... no one seems to know the answer.

www.madewithpixels.co.uk
design | graphics | multimedia

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 50 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

frameset javascript syntax - multiple targets problems

As this is primarily a CSS forum for lovers of code purity and accessibility, you might find more people able to help you on a Javascript forum. Just a thought!

Life's a b*tch and then you die!

mickieluv
Offline
Regular
Last seen: 16 years 4 days ago
Joined: 2004-07-09
Posts: 20
Points: 0

frameset javascript syntax - multiple targets problems

sorry, i thought i'd posted in the off topic forum (it was a very very long night)

I'd posted in a couple if javascript forums and had no luck... cssforum was my last hope!

i did fix it in the end tho!... and was inspired to start the whole thing again in pure css, my head hurts already!

sorry for the confusion Laughing out loud

www.madewithpixels.co.uk
design | graphics | multimedia