473,770 Members | 6,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subtle Javascript Problem In Firefox

Here is the site in question:

http://dev.unmeaningflattery.com/

Open it in Firefox (this problem does not occur in IE).

Click on one of the image thumbnails to see the larger image appear
(works by changing "display" property). Note how you can arrow up and
down the page or (if you have it) use your mouse scroll button to move
up and down the page.

Click the CLOSE button next to the larger image that appeared.

Once it disappears, see how you can't scroll anymore? If you click
again inside the browser window, you can scroll just fine.

Somewhat annoying.

I think what's happening is when you click the close button (you can
also click the larger image to close it as well), it's "display"
property is set to "none" and then because the last object with focus
is now no longer displayed, Firefox gets confused about its
context/position on the page and doesn't allow you to scroll up and
down until you click inside the window and reset the focus on a visible
part of the page.

Do you guys agree? Anyone have any thoughts on how I can fix this?

I've tried adding an additional last line in the function that toggles
the display value. That extra line sets the focus to just the window,
but it doesn't seem to fix the bug.

Thanks for any ideas you have that might allow me to fix this
admittedly minor but annoying bug.

-peter

Jul 23 '05 #1
5 1880
The Googler <go****@warcode .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Here is the site in question:

http://dev.unmeaningflattery.com/

Open it in Firefox (this problem does not occur in IE).

Click on one of the image thumbnails to see the larger image appear
(works by changing "display" property). Note how you can arrow up and
down the page or (if you have it) use your mouse scroll button to move
up and down the page.

Click the CLOSE button next to the larger image that appeared.

Once it disappears, see how you can't scroll anymore? If you click
again inside the browser window, you can scroll just fine.

Somewhat annoying.

I think what's happening is when you click the close button (you can
also click the larger image to close it as well), it's "display"
property is set to "none" and then because the last object with focus
is now no longer displayed, Firefox gets confused about its
context/position on the page and doesn't allow you to scroll up and
down until you click inside the window and reset the focus on a visible
part of the page.

Do you guys agree? Anyone have any thoughts on how I can fix this?

I've tried adding an additional last line in the function that toggles
the display value. That extra line sets the focus to just the window,
but it doesn't seem to fix the bug.

Thanks for any ideas you have that might allow me to fix this
admittedly minor but annoying bug.

-peter


Check the JS console. Using Mozilla, I get this :
Error: document.elemen ts has no properties
Source File: http://dev.unmeaningflattery.com/
Line: 274

--
S.C.

Jul 23 '05 #2
That error is left over from me trying to fix this problem. I've now
removed the error-producing code but the bug is still there.
Sorry for the confusion.

Jul 23 '05 #3
"The Googler" <go****@warcode .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
That error is left over from me trying to fix this problem. I've now
removed the error-producing code but the bug is still there.
Sorry for the confusion.


It might just be the way the browsers work. However, this _might_ have
something to do with it (and you should change it regardless, since the
use of the javascript: psuedo-protocol is not recommended <url:
http://jibbering.com/faq/#FAQ4_24 />):

<A HREF="Javascrip t:changeImages( 'CLOSE18',
'images_ssi/close_off.gif') ;showhide2('IMG 5FULL');" ...>

Change that to:

<a href="#" onclick="
changeImages('C LOSE18', 'images_ssi/close_off.gif') ;
showhide2('IMG5 FULL');
return false;
" ...>

(split across lines to make it readable)

-
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #4
Thanks for the tip, Grant!
I fixed the HREF formatting but the problem still remains.

-peter

Jul 23 '05 #5
it seems like it's a browser thing ... but may be this trick will help
(only tested it against Firefox 1.0)

here's a modifiied version of your showhide2 function:

function showhide2(objSh owHide){
d=document;laye r="";
if(d.getElement ById)layer1=d.g etElementById(o bjShowHide).sty le;
else if(d.layers)lay er1=document.la yers[objShowHide];
//else return 1;

//alert(layer1.st yle);
if(layer1.displ ay=="")layer1.d isplay="none";
//if(layer1.displ ay!="none")laye r1.display="non e";
//else layer1.display= "block";
else layer1.display = "";

d.forms[0].xxx.focus();
}

I cleaned it up a bit for clarity. Also, the last line gives the focus
to a hidden input field. That means, you should put all your page
content inside a <form> tag and create an <input type="hidden"
name="xxx"> field (name it whatever). The idea is to give the focus
back to an element in the page (has to be a form control).
hope that helps.

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
1948
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can (in)validate my Javascript code. First, I'll describe the purpose of the Javascript code. I often have a need to post a URL to something at my own web site, e.g., http://www.standards.com/Sorting/SortPerformanceComparison-Description.html. It is...
8
3674
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
2330
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
11
3433
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console shows that there are numerous errors occuring. It looks like the web browser does not recognise...
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10225
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10053
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10001
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.