X
Tippen Sie hierhin, um die Version dieser Website für Mobilgeräte aufzurufen.

Hilfeforum

Background-images won't display when css display is "none" and program template changes display to "block" or any other visible display, e.g., "inline."

  • Keine Antworten
  • 1 hat dieses Problem
  • 2 mal aufgerufen
Veröffentlicht

I am running a game program with templates linked to css for display. With Javascript, I change divs, tables, &c., from display:none to, e.g., display:block. All the attributes work EXCEPT the background image. So, for example, if background color is #000000, the background shows solid black, and if I change that ahead of time or even on the fly to, e.g., #FF0000, the background changes onclick to solid red. But, the background image appears pretty much at random as the computer pleases. So, for example, the background-image is set by css for a table where display:none is the setting. The template changes the table to display:inline-block. The table appears, the background color appears, but often no background image appears UNLESS I open the console and uncheck, then recheck some property, e.g., height, associated with the background image. If, however, I set the initial table property to, e.g., display:inline, the initial result shows a bunch of garbage, but once the display is switched to inline-block, all the background images appear normally and regularly. This appears to be some kind of bug with Firefox, but for the life of me, I cannot fix it. If the display of an element -- article, div, table -- starts in the css as "none," the background image often does not appear when display is switched on.

I am running a game program with templates linked to css for display. With Javascript, I change divs, tables, &c., from display:none to, e.g., display:block. All the attributes work EXCEPT the background image. So, for example, if background color is #000000, the background shows solid black, and if I change that ahead of time or even on the fly to, e.g., #FF0000, the background changes onclick to solid red. But, the background image appears pretty much at random as the computer pleases. So, for example, the background-image is set by css for a table where display:none is the setting. The template changes the table to display:inline-block. The table appears, the background color appears, but often no background image appears UNLESS I open the console and uncheck, then recheck some property, e.g., height, associated with the background image. If, however, I set the initial table property to, e.g., display:inline, the initial result shows a bunch of garbage, but once the display is switched to inline-block, all the background images appear normally and regularly. This appears to be some kind of bug with Firefox, but for the life of me, I cannot fix it. If the display of an element -- article, div, table -- starts in the css as "none," the background image often does not appear when display is switched on.
Zitieren

Mehr Details zum System

Installierte Plugins

None I know of.

Anwendung

  • User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.2988.0 Safari/537.36

Weitere Informationen

Sie müssen sich mit Ihrem Benutzerkonto anmelden, um auf Beiträge zu antworten. Bitte stellen Sie eine neue Frage, wenn Sie noch kein Benutzerkonto haben.