csshover.htc doesn't always work

13 views
Skip to first unread message

Edward Hass

unread,
Dec 23, 2007, 3:24:05 PM12/23/07
to
I am using csshover.htc to allow me to use the hover pseudo element in IE6.
The following excerpted code works fine in IE6 when I load the file locally.
When I upload it to my ISP and load it from there in IE6, it doesn't work.
(It works fine in all other browsers, both locally and from my ISP.)

The purpose of this code is to have an image appear to the right of the
question when you hover over the block of text that has a question in it.

Any ideas on why this is happening, and how to fix it?
_____________________________________________________
<style type="text/css">
.mainpoint {border: 2px solid red; width:25%; background-color: #fe5200;
position: relative; }

.mainpoint img {display:none;}

.mainpoint:hover img {display:block; position: absolute; top: -100px; left:
225px; }

body {behavior: url(csshover.htc)}
</style>

<body>
<div class="mainpoint">
Question One
<img src="images/Answer1.gif" alt =" " />
</div>
</body>

Thanks to all,
Edward Hass


dorayme

unread,
Dec 23, 2007, 5:25:31 PM12/23/07
to
In article <Ftzbj.4202$yC6.673@trndny05>,
"Edward Hass" <news...@magiciandb.com> wrote:

> I am using csshover.htc to allow me to use the hover pseudo element in IE6.
> The following excerpted code works fine in IE6 when I load the file locally.
> When I upload it to my ISP and load it from there in IE6, it doesn't work.
> (It works fine in all other browsers, both locally and from my ISP.)
>
> The purpose of this code is to have an image appear to the right of the
> question when you hover over the block of text that has a question in it.
>
> Any ideas on why this is happening, and how to fix it?

http://tinyurl.com/24qh93

--
dorayme

Jonathan N. Little

unread,
Dec 23, 2007, 5:25:02 PM12/23/07
to
Edward Hass wrote:
> I am using csshover.htc to allow me to use the hover pseudo element in IE6.
> The following excerpted code works fine in IE6 when I load the file locally.
> When I upload it to my ISP and load it from there in IE6, it doesn't work.
> (It works fine in all other browsers, both locally and from my ISP.)

That is because *other* browsers *do not* use the csshover.htc


>
> The purpose of this code is to have an image appear to the right of the
> question when you hover over the block of text that has a question in it.
>
> Any ideas on why this is happening, and how to fix it?

No. Not without a URL to the page! csshover.htc is just a name for a MS
proprietary script (hack). There is no just one "The csshover.htc"
script, there are many and it could be coded many ways...

Looking in my crystal ball I'd say the most likely reason is that it is
located in a different location relative to the arrangement on your hard
drive.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Edward Hass

unread,
Dec 24, 2007, 2:06:08 AM12/24/07
to
>>I am using csshover.htc to allow me to use the hover pseudo element in
>>IE6. The following excerpted code works fine in IE6 when I load the file
>>locally. When I upload it to my ISP and load it from there in IE6, it
>>doesn't work. Any ideas on why this is happening, and how to fix it?

>>snip

Jonathan N. Little replied:


>
> No. Not without a URL to the page! csshover.htc is just a name for a MS
> proprietary script (hack). There is no just one "The csshover.htc" script,
> there are many and it could be coded many ways...

The problem page is at www.feltsongs.com/ed.html

The csshover.htc file I am using can be found at:
http://www.xs4all.nl/~peterned/htc/csshover2.htc

It is in the same directory as my HTML file, on my local machine and on my
ISP's server.

I've tried url(csshover.htc) and url(./csshover.htc). Both work locally,
neither works from my ISP.

Any suggestions for other htc files?

This one's driving me crazy. I've seen this problem reported before. . .not
seen any solutions that work(sigh).

Thanks,
Edward Hass


Jonathan N. Little

unread,
Dec 24, 2007, 10:44:49 AM12/24/07
to
Edward Hass wrote:
>>> I am using csshover.htc to allow me to use the hover pseudo element in
>>> IE6. The following excerpted code works fine in IE6 when I load the file
>>> locally. When I upload it to my ISP and load it from there in IE6, it
>>> doesn't work. Any ideas on why this is happening, and how to fix it?
>
>>> snip
>
> Jonathan N. Little replied:
>> No. Not without a URL to the page! csshover.htc is just a name for a MS
>> proprietary script (hack). There is no just one "The csshover.htc" script,
>> there are many and it could be coded many ways...
>
> The problem page is at www.feltsongs.com/ed.html
>
> The csshover.htc file I am using can be found at:
> http://www.xs4all.nl/~peterned/htc/csshover2.htc
>
> It is in the same directory as my HTML file, on my local machine and on my
> ISP's server.
>
> I've tried url(csshover.htc) and url(./csshover.htc). Both work locally,
> neither works from my ISP.


Since you have it in the same folder as your page url(csshover.htc) is
fine. It works for me, so th4e problem is most likely you have a old
version in your browser cache.


>
> Any suggestions for other htc files?

I use a much simpler version that I tweaked at

http://www.littleworksstudio.com/styles/IEFixes.htc

You can see it in action at:

http://www.littleworksstudio.com/CSTC2007.php

Advantage is you only have to add the class ".hover" for IE that is the
same as the ":hover" for modern web browser and I only attached it to
the element on class that I need add the effect.

element:hover,
element.hover { ... }

element { behavior: url(EFixes.htc); }

or just a class:

.someClass:hover,
.someClass.hover { ... }

.someClass { behavior: url(EFixes.htc); }

Edward Hass

unread,
Dec 24, 2007, 6:25:58 PM12/24/07
to
"Jonathan N. Little" <lws...@centralva.net> wrote in message
news:d4b5a$476fd408$40cba7a9$47...@NAXS.COM...

> Edward Hass wrote:
>>>> I am using csshover.htc to allow me to use the hover pseudo element in
>>>> IE6. The following excerpted code works fine in IE6 when I load the
>>>> file locally. When I upload it to my ISP and load it from there in IE6,
>>>> it doesn't work. Any ideas on why this is happening, and how to fix it?
>>
>>>> snip

>> Any suggestions for other htc files?


>
> I use a much simpler version that I tweaked at
>
> http://www.littleworksstudio.com/styles/IEFixes.htc
>

Sorry Jonathan, I obviously misunderstand your instructions. Here's a
simple test example. Would you be so kind as to show me the necessary
changes to make this work in IE6? This works fine in Firefox. . .it's a
simple rollover to change the text colors. With csshover.htc it works fine
in IE6 locally, but not from an ISP. I really appreciate the time you're
taking with this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Testing hover</title>
<style type="text/css">
body {behavior: url(./csshover.htc);}
.abc { width: 100px; background-color: aqua; }
.abc:hover {background-color: navy; color: white; }
</style>
</head>
<body >
<div class="abc">
This is some text
</div>
</body>
</html>

Thanks (hugely!)
Edward Hass


Jonathan N. Little

unread,
Dec 24, 2007, 11:30:56 PM12/24/07
to

Not sure about your HTC but mine the style would be


/* just add the behavior to elements with this class */
.abc { behavior: url(IEFixes.htc); }


.abc { width: 100px; background-color: aqua; }

/* for modern web browse with pseudo class support */


.abc:hover {background-color: navy; color: white; }

/* special 'hover' class for ol' IE */
.abc.hover {background-color: navy; color: white; }

The HTC file that I am using just this:

<public:component>
// For MSIE use JScript to attach JS functions to compensate
// for missing pseudo-class support
// from Vladdy http://www.vladdy.net/Demos/IEPseudoClassesFix.html
// updated for html4.01 jnl 3/06
// added focus|blur jnl 5/07
<public:attach event="onmouseover" onevent="DoHover()">
<public:attach event="onmouseout" onevent="RestoreHover()">
<public:attach event="onmousedown" onevent="DoActive()">
<public:attach event="onmouseup" onevent="RestoreActive()">
<public:attach event="onfocus" onevent="DoFocus()">
<public:attach event="onblur" onevent="RestoreFocus()">
<script type="text/jscript">
function DoHover(){
element.className += ' hover';
}
function DoActive(){
element.className += ' active';
}
function DoFocus(){
element.className += ' focus';
}
function RestoreHover(){
element.className = element.className.replace(/\shover\b/,'');
}
function RestoreActive(){
element.className = element.className.replace(/\sactive\b/,'');
}
function RestoreFocus(){
element.className = element.className.replace(/\sfocus\b/,'');
}
</script>
</public:component>

Edward Hass

unread,
Dec 25, 2007, 9:47:39 AM12/25/07
to
"Jonathan N. Little" <lws...@centralva.net> wrote in message
news:dad33$477087fa$40cba7a9$20...@NAXS.COM...

> Edward Hass wrote:
>> "Jonathan N. Little" <lws...@centralva.net> wrote in message
>> news:d4b5a$476fd408$40cba7a9$47...@NAXS.COM...
>>> Edward Hass wrote:
>>>>>> I am using csshover.htc to allow me to use the hover pseudo element
>>>>>> in IE6. The following excerpted code works fine in IE6 when I load
>>>>>> the file locally. When I upload it to my ISP and load it from there
>>>>>> in IE6, it doesn't work. Any ideas on why this is happening, and how
>>>>>> to fix it?
>>>>>> snip

Darn! Your solution has the same problem I've already encountered. It
works when I load it locally, doesn't work when I try to execute it from my
ISP. If you have IE6, could you please access
www.feltsongs.com/test2.html and tell me if you get the rollover effect or
not? this way I'll get a better idea if it has to do with my own IE
settings, or some other bizarre problem. (It's not browser cache, it failed
the first time I loaded it.)

Regards,
Edward Hass


John Hosking

unread,
Dec 25, 2007, 9:38:40 AM12/25/07
to
Edward Hass wrote:

>
> Darn! Your solution has the same problem I've already encountered. It
> works when I load it locally, doesn't work when I try to execute it from my
> ISP. If you have IE6, could you please access

> http://www.feltsongs.com/test2.html and tell me if you get the rollover effect

> or not? this way I'll get a better idea if it has to do with my own IE
> settings, or some other bizarre problem. (It's not browser cache, it failed
> the first time I loaded it.)

Works on my IE6, just like on my FF, upon my very first visit in each.

HTH. GL.

--
John

Jonathan N. Little

unread,
Dec 26, 2007, 11:32:23 AM12/26/07
to
Edward Hass wrote:
> "Jonathan N. Little" <lws...@centralva.net> wrote in message
> news:dad33$477087fa$40cba7a9$20...@NAXS.COM...
>> Edward Hass wrote:
>>> "Jonathan N. Little" <lws...@centralva.net> wrote in message
>>> news:d4b5a$476fd408$40cba7a9$47...@NAXS.COM...
>>>> Edward Hass wrote:
>>>>>>> I am using csshover.htc to allow me to use the hover pseudo element
>>>>>>> in IE6. The following excerpted code works fine in IE6 when I load
>>>>>>> the file locally. When I upload it to my ISP and load it from there
>>>>>>> in IE6, it doesn't work. Any ideas on why this is happening, and how
>>>>>>> to fix it?
>>>>>>> snip
>
> Darn! Your solution has the same problem I've already encountered. It
> works when I load it locally, doesn't work when I try to execute it from my
> ISP. If you have IE6, could you please access
> www.feltsongs.com/test2.html and tell me if you get the rollover effect or
> not? this way I'll get a better idea if it has to do with my own IE
> settings, or some other bizarre problem. (It's not browser cache, it failed
> the first time I loaded it.)

It must be something in your IE setup. It works for me from your website
in MSIE5.01, 5.5, 6.01, and 7!

Jonathan N. Little

unread,
Dec 26, 2007, 11:35:28 AM12/26/07
to
Edward Hass wrote:

> Darn! Your solution has the same problem I've already encountered. It
> works when I load it locally, doesn't work when I try to execute it from my
> ISP. If you have IE6, could you please access
> www.feltsongs.com/test2.html and tell me if you get the rollover effect or
> not? this way I'll get a better idea if it has to do with my own IE
> settings, or some other bizarre problem. (It's not browser cache, it failed
> the first time I loaded it.)

Just thought of something. You may have "active scripting" disabled in
your Internet zone of your security settings but not for Local.

Edward Hass

unread,
Dec 26, 2007, 10:31:37 PM12/26/07
to
> Just thought of something. You may have "active scripting" disabled in
> your Internet zone of your security settings but not for Local.
>
> --
> Take care,
>
> Jonathan


EUREKA!!!!!!!!!!!

It's not active scripting (that's in the Advanced Tab, and I had it
enabled.)

I clicked on "Default Level" in the Security Tab, and all started working.


Thanks hugely John, and others who took time to tackle this.

Edward Hass


Jonathan N. Little

unread,
Dec 27, 2007, 12:24:15 PM12/27/07
to
Edward Hass wrote:
>> Just thought of something. You may have "active scripting" disabled in
>> your Internet zone of your security settings but not for Local.

>

> EUREKA!!!!!!!!!!!
>
> It's not active scripting (that's in the Advanced Tab, and I had it
> enabled.)
>
> I clicked on "Default Level" in the Security Tab, and all started working.
>
>
> Thanks hugely John, and others who took time to tackle this.
>

Process of elimination. Your IE was the only one that was have problems
and only online.

Reply all
Reply to author
Forward
0 new messages