Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BG image keeps vanishing 2

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I'm updating the DOM with a few input fields of type button with a bg image via AJAX.

if I load a different page and then re-load the previous page sometimes the images aren't showing.

if I move over the button the background image just appears.

There is no set pattern to which images don't show and the CSS and code is correct as they show fine on first page load.

I've done extensive testing in FireFox and don't get this problem.

Is it an IE8 bug?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
We often fix these IE specific problems by trigger the hasLayout property on the node. This can be done using "zoom:1", or setting a background-color etc.

Just a thought.

Cheers!
Jeff

[tt]Visit my blog [!]@[/!] Visit Code Couch [!]@[/!] [/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Does your HTML and CSS validate?

Impossible to totaly work that one out as I am writing a complete AJAX application and so the source of the page isn't what is being displayed as the DOM is updated with innerHTML.

Plus as it's behind password protection / required login W3C cannot get to the page.

I can't simply copy paste the code as the dynamic content loaded is only partly formed X/HTML without full headers / head / body and other required tags.

How is it possible to validate such pages?

I'll try the background-color setting and see if that does the trick.



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
spot on Jeff, added a BG colour of white to match the BG image used and so far the images have not done their dissapearing act.

However, if you set a BG image to an element via CSS, isn't that trigering hasLayout?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
How is it possible to validate such pages?

If you have Firefox with the Web Developer toolbar installed, you can click "Tools -> Validate Local HTML" and "Tools -> Validate Local CSS".

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
cool, nice one Dan, I've added the extension and will use it for final testing before I release the app.

I still develop in IE and then test in FF and Opera.

Regardless of the debate over which browser is better, the most common is IE, so that's the one i use to make it work with first, rightly or wrongly ;-)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
I validated the page, and did further testing, the images still keep vanishing.

I'm not sure there is anything that can be done as it doesn't happen in compatability mode or in IE7, i'm assuming it has to be an IE8 specific bug.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
If you can't give us the real URL, I suggest creating a cut-down test harness and posting the URL here.

You might even find the issue along the way!

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
a cut down version would require would require far to much re-coding as it's an AJAX app.

i've emailed via the code couch contact us page, if that's of any help.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top