Closed Bug 141073 Opened 24 years ago Closed 21 years ago

javascript function doesn't work in element beside an image if the page is scrolled down

Categories

(Core :: DOM: Events, defect, P4)

x86
All
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: arcolf, Assigned: saari)

References

()

Details

(Whiteboard: [DUPEME])

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0rc1) Gecko/20020417 BuildID: 2002041711 I have a page with a large image and two links on the left and right side of the image. The links call a Javascript function, which opens an alert popup. When you click on the link, the popup doesn't pop up. The window only moves a bit up to the begin of the image. If you insert a <br> between the <a> and the <img> the function works and the popup appears. Reproducible: Always Steps to Reproduce: 1. Open the url http://stud3.tuwien.ac.at/~e9725141/test.html 2. Click on the test links beside the image => no popup 3. Click on the test links above or below the image => alert popup appears Expected Results: The popup should always appear, no matter if the link is beside, above or below the image
seeing the same with Linux build 20020428 I think what you're seeing is related to the fact that Mozilla seems to scroll such that the line that contains the link you clicked is on the screen. Unfortunately, it seems that this scrolling also breaks the JavaScript. To see this, notice that the left/right test links work if you're already at the top of the page. Also the top/bottom tests don't work if the text is not fully on the screen.
OS: Windows 98 → All
To events. This is a known problem -- the onfocus is fired first, then we scroll, then we fire onclick to whatever is now under the pointer, which may no longer be the link....
Assignee: rogerl → joki
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Events
Ever confirmed: true
QA Contact: pschwartau → vladimire
*** Bug 156525 has been marked as a duplicate of this bug. ***
This works for me on recent builds on Mac and Windows. Resolving works for me. PS. I love the picture, if you are the one verifying this, you wont be sorry ;)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Bug 156525 still fails with Mozilla 1.3 alpha under Windows. Does the test case work with recent builds?
Is this bug working for you? I also see that that bug is failing. Perhaps its not a dupe after all.
on both bugs, if you make the window small enough I see both bugs. to reproduce this bug, make the window small enough that you get a scrollbar and make sure that top of the first image is not in the window. left-click on the link next to the first image. the window scrolls, but that's it. Vladimir and ostgote: are you sure this bug is WFM?
Ah, sorry. This doesnt work for me. I didnt see anything about scrolling down in the steps...
Status: RESOLVED → REOPENED
Component: DOM Events → Layout
Resolution: WORKSFORME → ---
Summary: javascript function doesn't work in element beside an image → javascript function doesn't work in element beside an image if the page is scrolled down
Doesnt sound like dom events, the issue is that the page scrolls up when the link is pressed, and when mouse is release it is no longer on the link, so the link never gets the click event. layout perhaps?
Assignee: joki → other
Status: REOPENED → NEW
QA Contact: vladimire → ian
Priority: -- → P4
Target Milestone: --- → Future
I don't see this. Here is what I do: 1. Make sure the window is small enough that a vertical scrollbar appears on the right. 2. Click on the link to the right of the first picture. 3. A popup shows up. It is my understanding that if this bug existed, #3 would not happen. Maybe this was fixed in recent builds? I have WinXP 2003012908.
This bug is not fixed. I've just tested in with 1.3b final on Win NT 4.0 again. John: Are you sure the vertical scrollbar was not on top (see summary)? If the scrollbar is on top your step 2 works but if the scrollbar is somewhere below it doesn't work. The effect is only an upward scrolling, no alert.
1. Make sure the window is small enough that a vertical scrollbar appears on the right. ** 1.5. scroll the first image at least partially off the top of the page. 2. Click on the link to the right of the first picture. 3. A popup shows up.
Ah, thanks, now I see it too.
Back to events, where it belongs. bz's assessment of the situation is correct, and you can see it if you hold the mouse down longer before you finish clicking. Hold the mouse down, the element is focused and the page moves to fit the entire block; then when you mouse up, the mouse is no longer on the <a href> and therefore the click does not happen (a click only happens if you mousedown and mouseup on the same element). The bug here could probably be fixed by fixing the code that scrolls to fit the element; perhaps that code should only scroll to the top of the <a href>, not the entire block including the img. Then again, perhaps that would break something ;)
Assignee: other → saari
Component: Layout → DOM Events
QA Contact: ian → desale
Whiteboard: [DUPEME]
Hmm ... this bug and bug 156525 now works for me. Moz 1.7a build 2004021508 WinNT4.
(In reply to comment #15) > Hmm ... this bug and bug 156525 now works for me. WFM with Mozilla 1.7.3, Mozilla 1.8a4, and 1.8a5 build 2004101405 on WinNT4. Could be closed?
worksforme as well with linux trunk 2004101606
Status: NEW → RESOLVED
Closed: 23 years ago21 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.