Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / December 2007



Tip: Looking for answers? Try searching our database.

csshover.htc doesn't always work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edward Hass - 23 Dec 2007 20:24 GMT
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
Jonathan N. Little - 23 Dec 2007 22:25 GMT
> 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.

Signature

Take care,

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

Edward Hass - 24 Dec 2007 07:06 GMT
>>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 - 24 Dec 2007 15:44 GMT
>>> 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
[quoted text clipped - 18 lines]
> 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); }

Signature

Take care,

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

Edward Hass - 24 Dec 2007 23:25 GMT
>>>> 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 - 25 Dec 2007 04:30 GMT
>>>>> 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
[quoted text clipped - 31 lines]
> </body>
> </html>

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>

Signature

Take care,

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

Edward Hass - 25 Dec 2007 14:47 GMT
>>>>>> 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 - 25 Dec 2007 14:38 GMT
> 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
[quoted text clipped - 3 lines]
> 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.

Signature

John

Jonathan N. Little - 26 Dec 2007 16:32 GMT
>>>>>>> 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
[quoted text clipped - 10 lines]
> 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!

Signature

Take care,

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

Jonathan N. Little - 26 Dec 2007 16:35 GMT
> 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
[quoted text clipped - 3 lines]
> 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.

Signature

Take care,

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

Edward Hass - 27 Dec 2007 03:31 GMT
> 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.

Edward Hass
Jonathan N. Little - 27 Dec 2007 17:24 GMT
>> Just thought of something. You may have "active scripting" disabled in
>> your Internet zone of your security settings but not for Local.

> EUREKA!!!!!!!!!!!
>
[quoted text clipped - 4 lines]
>
> 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.

Signature

Take care,

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

dorayme - 23 Dec 2007 22:25 GMT
> 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.
[quoted text clipped - 5 lines]
>
> Any ideas on why this is happening, and how to fix it?

http://tinyurl.com/24qh93

Signature

dorayme

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.