PDA

Click to See Complete Forum and Search --> : Javascript: Strange IFrame.MoveTo error


WP
Dec 22nd, 2003, 06:54 AM
Hey guys,

There is something odd going on in my website. Its not for making publicity or something like that (its in Dutch so you wouldn't understand it anyway), but I want you to take a look at a particulary page on my site. The site is located on http://users.tijd.com/leuka/leukasite/main.htm then click, in the left menubar, on "WIE" (its the second button). A page will load with some pictures of people. when you move your mouse over one of these pictures, a profile sheet will load next to it. This just works fine. But when you move down with the slider on your right, and then try to get that profile sheet again, it will fail. Why? Why does it fail to work when you touched the slider??

The error occurs on the "iframe_profiles.moveTo(xxx,xxx);" line of the specified person. (thats what my debugger said)

Thanks in advance,
Willem Pardaens

ober0330
Dec 22nd, 2003, 07:44 AM
What browser are you using? It only fails for me on a few of them after sliding down using the scroll bar. And the ones it fails on makes my status bar go crazy until I move off of the picture.

WP
Dec 22nd, 2003, 08:30 AM
I use Microsoft's Internet Explorer 6.0.
On my computer it fails on all people after sliding down, and the statusbar's behavior is normal.

Any guesses on why it fails?

Thanks
Willem Pardaens

ober0330
Dec 22nd, 2003, 08:34 AM
OK, I just tried using IE 6. (I normally use MyIE2). It seems to work just fine doing all kinds of scrolling. What I found weird was the fact that it appears to put the description up above the mouse, almost off the screen.

Again, it doesn't appear to fail for me. :confused:

WP
Dec 22nd, 2003, 08:42 AM
The information has to be shown next to the picture. so if you only see half the picture in the screen, you will also only see half of the information.

Thanks for trying it. I now tried it also on another computer and it also seemd to work. I will have to find the problem on my computer :)

Thanks for helping,
Willem Pardaens

CornedBee
Dec 27th, 2003, 06:05 AM
Mozilla 1.5:

On the frontpage, the "Welcom" header is outside of its box.
Same goes for the headers on the other pages.

The whole thing is MSWord-generated HTML and looks absolutly terrible. You ought to use HTML Tidy (www.w3.org) or a similar tool to clean up the HTML.

The iframe needs the id attribute set instead of the name attribute. IE behaves incorrectly by allowing getElementById to find elements by their name, Mozilla doesn't, so getElementById('iframe_profiles') always returns null on Mozilla.
I assume that the same problem exists for all the other divs and iframes you try to reference via getElementById.

The <%@ directive shows up in the HTML page. Small wonder: processing directives are part of XML, not HTML. But I think Tidy will remove those.

The simple usage of an id/name without anything else is inviting trouble too. I'm not sure if it will work on Mozilla, it's not reliable in any case.

The page also tends to jump back to the main page without me doing anything, This is because of the setback function which starts with a history.go(-1). I don't know what you intend with it, but it certainly doesn't work as you intended.

bekkel
Dec 28th, 2003, 04:00 PM
what's the script doing.?
some times it's just reloading the first page again..?

WP
Dec 28th, 2003, 04:17 PM
That your brower is reloading the previous main page is because you move too fast over the different pictures/logos. When you move your mouse over it, it should load a page in an inline frame. When you move out of the picture (onmouseout) the page has to be unloaded, so i used the "history.go(-1)" function. but when you are too fast, the page is not loaded when you move your mouse out of the picture and the previous main page is reloaded.

I have to use the "history.go(-1)" function because, when i don't, the small pages in the inline frame will fill up the history, and your browser's back button will be useless. When you know another way of keeping certain pages out of the history, let me know! I will now fix it by checking, before the "history.go(-1)" function, if the page in the inline frame was loaded completely and thus added to the history.

To CornedBee: I will install Mozilla and some other browsers on my other computer so i can check the site with these browsers too. Thanks for the remarks.

To ober5861: It seems to work well on my computer too, but only if I click somewhere on the page after having scrolled. So, when I scroll and then move over a picture it fails, but when I scroll, then I click somewhere on the page and then move over a picture, it works fine. :)

There is still a lot to do * sigh * :)

Thanks all,
Willem Pardaens

bekkel
Dec 29th, 2003, 07:10 AM
there are much better script to show big ALT tags with pictures
without reloading your page etc
I think you've got a bad solution now..
example: http://www.myscript.co.il/myscript/mydhtml/move_links.htm
or better but without the code: http://www.admirant.nl/frameset.html (also cool intro)