views:

2456

answers:

3

I have a website that includes a button which is CSS-styled to show a distinct image on hover. I wait for the page to load completely, then move my mouse over that button.

Firefox will show the new image, but the status bar becomes stuck showing either "transferring data from www.server.com" or "waiting for www.server.com" and this never goes away. I can see via Firebug net view that the image is correctly downloaded at hover-time, and I see no other errors anywhere.

What can cause this? I am asking because I am having a spurious problem on this page with subsequent ajax-call completion scripts.

Anyone ever see FireFox get stuck showing this status? Reasons why?

+3  A: 

Don't know why it's getting stuck, but there are better methods of doing rollovers. Put both the regular and hover images in the same image. Then use background-position to do the rollover:

a.btn {
  background-image: url("/img/btn.png");
  background-position: 0px 0px;
}
a.btn:active {
  background-position: 0px 50px;
}
a.btn:hover {
  background-position: 0px 25px;
}

The above CSS is for a 3-state rollover with a height of 25px. The top image is just the regular image; beneath that is the hover image; and beneath that is the active image, which is shown when the link is clicked on.

This gets rid of any loading delays between rollover state changes. If you want to get fancy, you can even animate the transitions using JavaScript (by including transition frames).

Calvin
dont forget overflow: hidden, and make sure to specify a width. The technique described is called CSS Sprites. do a google search and youll find tons of information on it.
Scott M.
A: 

I am not familiar with this specific problem, but I did do some testing for Necko, the networking library that Gecko runs on.

Absent some code that is spoofing the status field, the status bar is indicating some kind of networking activity to www.server.com.

You should carefully look through your code, especially any js libraries you might load, to see if there is some unexpected network function that is kicked off.

If you cannot find anything obvious, you should move to doing a network trace or using HTTP logging, depending on which is easier for you.

If you cannot isolate a problem at this point, you may have found a new bug! Very unlikely, but this did happen during my stint on the module... You should file a bug in bugzilla.mozilla.org, following the latest-and-greatest bug filing rules.

benc
A: 

Depending on the operating system and the type of network, a network connection may stall for reasons like:

  • The operating system on the client only allows a certain number of connections to be opened at once.
  • The server only allows a certain number of connections from a single client (or IP address).

The default networking settings in Firefox should prevent 99% of problems, because Firefox prevents itself from opening too many connections to a server or opening connections too quickly. Also, if everything is functioning in a healthy manner, where opening a connection fails Firefox will queue whatever request it was going to make and put it out on another connection when it becomes available, or something like that.

Sometimes proxies can interfere with things, or even transparent proxies which your ISP uses without your knowledge. Sometimes there is just too much packet loss on a network that even TCP connections become unreliable.

However, based on the symptoms described - that it appears to be fully reproducable I'd probably look to the server. By all means nonitor network requests with Firebug and all, but also check server logs to see if anything is going wrong. If the web server received the request but was unable to serve it for some reason, then that should be logged.

thomasrutter