In recent versions of Opera-browser (10.5, 11) I'm getting it frozen when trying to display many images aligned horizontally and move the scrollbar quite far to the right.
I tried submitting a bug to Opera. But Opera 11 didn't have it fixed.
Steps to reproduce
- Add many pictures to the page, align them horizontally one by one
- Attach onclick javascript with scrollTo function (to an anchor around each picture) to scroll to next pic.
- When quite enough pictures have been scrolled one by one with the click, the page becomes frozen.
Expect开发者_Go百科ed result
The page is not frozen & continues scrolling
Actual result
The page becomes frozen
Please find the sample demonstrating the problem here: download the sample. The question is what's the problem & how to workaround it? Btw, older versions of Opera (10.0) & browsers like Firefox, IE do not have this problem.
Usually it is good to use dragonfly, the Web developer tool to identify issues with your javascript, css, etc.
Tested your file simple.zip, the scroll is stopping consistently on the 13th click. In Webkit it stopped on the 14th click, same thing for Firefox, the last white square doesn't come. it stay on the black.
ok. I noticed you had
for(var i=1; i<photosCount; ++i){
and if you replace it by
for(var i=1; i<=photosCount; ++i){
the script seems to be working. What about you?
PS: it is better to not use numbers for id in general. Specifically if you serve your data as xml with application/xhtml+xml.
精彩评论