DIV background not visible
-
Hi, Newbie on web development alert !! I've been trying to resolve this problem for days now and searched everywhere for a soultion. I have a main DIV containing 2 more DIVs: one with a some text and the other one with a background image set to an animated gif of a progress bar. The main DIV has been assigned a CSS class which simply sets VISIBILITY: hidden; There's a button on my page which when clicked makes a call to a web service, which can take some time to return. Therefore in the onClick of the button I call a javascript function which sets the CSS class of the mian DIV to another one which simply sets VISIBILITY: visible;. Problem is I can get this to work when I run the project within dotnet with default browser set to IE. If the browser is set to anything else the gif is not displayed, although the div with the text IS. If I publish the project and run it directly (from outside of dotnet IDE) then I can't see the image from any browser, but can still see the DIV with text. The URL of the image is just the image name, I tried putting an absolute path, but it still didn't work. I also tried using an image control inside the DIV, but doing this the gif only animates once which is why I used the background image of the DIV!!! Can someone please help!! Shakeel
-
Hi, Newbie on web development alert !! I've been trying to resolve this problem for days now and searched everywhere for a soultion. I have a main DIV containing 2 more DIVs: one with a some text and the other one with a background image set to an animated gif of a progress bar. The main DIV has been assigned a CSS class which simply sets VISIBILITY: hidden; There's a button on my page which when clicked makes a call to a web service, which can take some time to return. Therefore in the onClick of the button I call a javascript function which sets the CSS class of the mian DIV to another one which simply sets VISIBILITY: visible;. Problem is I can get this to work when I run the project within dotnet with default browser set to IE. If the browser is set to anything else the gif is not displayed, although the div with the text IS. If I publish the project and run it directly (from outside of dotnet IDE) then I can't see the image from any browser, but can still see the DIV with text. The URL of the image is just the image name, I tried putting an absolute path, but it still didn't work. I also tried using an image control inside the DIV, but doing this the gif only animates once which is why I used the background image of the DIV!!! Can someone please help!! Shakeel
Forgot to say that the main DIV which is being hidden and displayed sits inside another 'master' DIV. And I've just found that setting the z-index of the 'master' DIV to 1 and setting the visibility of the main DIV to visible, allows me to view the image (when running in debug) on all browsers (netscape, ie, opera & firefox). So that's one step closer. But I'm still having the problem where clicking on the button is still not displaying the gif when initially hidden.
-
Hi, Newbie on web development alert !! I've been trying to resolve this problem for days now and searched everywhere for a soultion. I have a main DIV containing 2 more DIVs: one with a some text and the other one with a background image set to an animated gif of a progress bar. The main DIV has been assigned a CSS class which simply sets VISIBILITY: hidden; There's a button on my page which when clicked makes a call to a web service, which can take some time to return. Therefore in the onClick of the button I call a javascript function which sets the CSS class of the mian DIV to another one which simply sets VISIBILITY: visible;. Problem is I can get this to work when I run the project within dotnet with default browser set to IE. If the browser is set to anything else the gif is not displayed, although the div with the text IS. If I publish the project and run it directly (from outside of dotnet IDE) then I can't see the image from any browser, but can still see the DIV with text. The URL of the image is just the image name, I tried putting an absolute path, but it still didn't work. I also tried using an image control inside the DIV, but doing this the gif only animates once which is why I used the background image of the DIV!!! Can someone please help!! Shakeel
Now fixed !!! Just typical, got it to work as soon as I asked for help. As I said before, had to set the z-index for the outer DIV to 1, for some reason it was set to some large number. Secondaly, in my Javascript, when setting the classname of the DIV, had to reference the DIV by
document.getElementById
method, otheriwse it only seemed to work with ie. Thanks for looking Shakeel