X
點擊此處開啟此網站的行動版。

技術支援討論區

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."

  • 無回覆
  • 1 有這個問題
  • 2 觀看次數
已張貼

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.
引用

額外的系統細節

已安裝的外掛程式

None I know of.

應用程式

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

更多資訊

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題