Forum Moderators: not2easy

Message Too Old, No Replies

CSS Validation Error

Sliding Frame Javascript getting in the way...

         

campbelt

3:30 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



Hello everyone,

I just recently joined these forums and so far everyone has been very helpful. I look forward to the day in which I might be able to log on in here and help answer people's questions, but for now, I'm afraid I'm the one on the left side of the learning curve :)

Anyway, I am wondering if anyone might be able to help me find a solution to my most recent challenge. When trying to validate the CSS on one of my sites using the W3C validation tool, I discovered that the following does not validate:

<a href="javascript:gotoshow();"><img alt="Slide Show" src="http://www.redrock-bomanite.com/v2/images/slides/06.jpg" id="slideshow" style="[b]filter:progid:DXImageTransform.Microsoft.Fade(duration=3)[/b];" width="300" height="300" /></a>

See the actual application here [redrock-bomanite.com]

While the answer to this question might fall under a different forum category, does anyone here know what techniques are available, if any, to achieve the same effect, but in a manner that will validate against W3C standards?

Thank you in advance.

Fotiman

4:26 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Since that style only applies for IE, you could use a conditional comment to hide the style rule from all browsers except IE. You wouldn't be able to have it an inline style, but you really should avoid inline styles whenever possible.

campbelt

9:58 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



Fotiman,

Yeah, I'm thinking about just pulling that feature out altogether. Not using it would certainly be the easiest solution, though I am still interested in knowing whether there are some other tricks, say through DHTML or somthing through which I can achieve a similar result without the messiness.

campbelt

Fotiman

10:31 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So, just to reiterate what I said...

In the head of your document:


<!--[if IE]>
<style type="text/css">
#slideshow {
filter:progid:DXImageTransform.Microsoft.Fade(duration=3);
}
</style>
<![endif]-->

And then change your HTML to this:


<img alt="Slide Show" src="http://www.redrock-bomanite.com/v2/images/slides/06.jpg" id="slideshow" width="300" height="300" />