Jump to content

Csshover.htc ?


CanadianGuy

Recommended Posts

Is ”csshover.htc” a commonly known file for drop down menus? Are you familiar with this file? If so could you please explain (in layman’s terms) what this file does.I ask this question as I came across a drop down menu that I would like to know just how it works. The menu was offered as a tutorial and included a zip file with the required files that included csshover.htc.Playing with the CSS and HTML I’ve had some unexpected results and I’m wondering just what this file is doing and how it is effecting what I am trying to do.I’ve looked at csshover.htc and I am sure I won’t have the knowledge to edit this file any time soon. So I’m wondering if I am perhaps wasting my time trying to learn from this tutorial.As always your wisdom is appreciated.

Link to comment
Share on other sites

could you post it? .htc I think is a server extension.css hover effect is pseudo class and can just be declared within a standard .css page.

Link to comment
Share on other sites

Sure...The HTML code that calls the file is...<!--[if lt IE 7]><style type="text/css" media="screen">body {behavior: url(csshover.htc);font-size: 100%;}</style>csshover.htc...

<public:attach event="ondocumentready" onevent="CSSHover()" /><script>/** *	Whatever:hover - V3.00.081222 *	-------------------------------------------------------- *	Author  - Peter Nederlof, [url="http://www.xs4all.nl/~peterned"]http://www.xs4all.nl/~peterned[/url] *	License - [url="http://creativecommons.org/licenses/LGPL/2.1"]http://creativecommons.org/licenses/LGPL/2.1[/url] *	Packed  - [url="http://dean.edwards.name/packer"]http://dean.edwards.name/packer[/url] * *	howto: body { behavior:url("csshover3.htc"); } */eval(function(p,a,c,k,e,r){e=function©{return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e©]=k[c]||e©;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e©+'\\b','g'),k[c]);return p}('r.R=(8(){4 f=/(^|\\s)((([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(C|D|E))/i,S=/(.*?)\\:(C|D|E)/i,T=/[^:]+[a-z-]+).*/i,U=/(\\.([a-V-W-]+):[a-z]+)|(:[a-z]+)/1c,X=/\\.([a-V-W-]*Y(C|D|E))/i,Z=/1d (5|6|7)/i,10=/1e/i;4 g=\'1f-\';4 h={p:[],t:{},11:8(){n(!Z.F(1g.1h)&&!10.F(r.12.1i))u;4 a=r.12.1j,l=a.v;w(4 i=0;i<l;i++){3.G(a[i])}},G:8(a){n(a.H){I{4 b=a.H,l=b.v;w(4 i=0;i<l;i++){3.G(a.H[i])}}J(13){}}I{4 c=a.1k,l=c.v;w(4 j=0;j<l;j++){3.14(c[j],a)}}J(13){}},14:8(a,{4 c=a.1l;n(f.F©){4 d=a.K.1m,L=S.15©[1],M=c.N(T,\'Y$1\'),O=c.N(U,\'.$2\'+M),o=X.15(O)[1];4 e=L+o;n(!3.t[e]){b.16(L,g+o+\':1n(R(3, "\'+M+\'", "\'+o+\'"))\');3.t[e]=17}b.16(O,d)}},18:8(a,b,c){4 d=g+c;n(a.K[d]){a.K[d]=q}n(!a.x)a.x=[];n(!a.x[c]){a.x[c]=17;4 e=19 P(a,b,c);3.p.1o(e)}u b},y:8(){I{4 l=3.p.v;w(4 i=0;i<l;i++){3.p[i].y()}3.p=[];3.t={}}J(e){}}};r.Q(\'1p\',8(){h.y()});4 k={1q:{9:\'1r\',m:\'1s\'},1t:{9:\'1u\',m:\'1v\'},1a:{9:\'1a\',m:\'1w\'}};8 P(a,b,c){3.A=a;3.B=b;4 d=19 1x(\'(^|\\\\s)\'+c+\'(\\\\s|$)\',\'g\');3.9=8(){a.o+=\' \'+c};3.m=8(){a.o=a.o.N(d,\' \')};a.Q(k[b].9,3.9);a.Q(k[b].m,3.m)}P.1y={y:8(){3.A.1b(k[3.B].9,3.9);3.A.1b(k[3.B].m,3.m);3.9=q;3.m=q;3.A=q;3.B=q}};u 8(a,b,c){n(a){u h.18(a,b,c)}1z{h.11()}}})();',62,98,'|||this|var||||function|activator|||||||||||||deactivator|if|className|elements|null|window||callbacks|return|length|for|csshover|unload||node|type|hover|active|focus|test|parseStylesheet|imports|try|catch|style|affected|pseudo|replace|newSelect|CSSHoverElement|attachEvent|CSSHover|REG_AFFECTED|REG_PSEUDO|REG_SELECT|z0|9_|REG_CLASS|on|REG_MSIE|REG_COMPAT|init|document|securityException|parseCSSRule|exec|addRule|true|patch|new|onfocus|detachEvent|gi|msie|backcompat|csh|navigator|userAgent|compatMode|styleSheets|rules|selectorText|cssText|expression|push|onbeforeunload|onhover|onmouseenter|onmouseleave|onactive|onmousedown|onmouseup|onblur|RegExp|prototype|else'.split('|'),0,{}));</script>

Makes my head hurt just looking at it. :)

Link to comment
Share on other sites

.htc files define methods used by the IE CSS behaviors property. This property is not available in other browsers and is not part of the W3C standard. Some behaviors expand the capability of IE. Others give it a kind of parity with browsers that have been quicker to adopt CSS2-3 properties.In this case, it would seem that the behavior is designed to make up for deficiencies in IE6, which limits :hover and related pseudo classes to <a> elements only. Since CSS menus typically rely on :hover, a hack like this gives IE6 the same functionality.EDIT: that code you posted doesn't make much sense because it has been compressed/obfuscated. In its present form, it's not the sort of thing you try to understand or study. Even if you unpacked it, it would be hard to read, because the objects will not have meaningful identifiers (meaningful to humans).There are .htc files out there that are not obfuscated, but I don't personally see much point in learning a skill that is useful for the products of only one manufacturer. Maybe if you did a lot of in-house programming, and the firm was 100% committed to IE.

Link to comment
Share on other sites

If I understand correctly I could then scrap this file for IE 7 and 8 and all other browsers. I am not too concerned about IE6. If folks are still using 6 it is high time they update.Which brings up an other question. Is there a method to redirect IE 6 browsers to a different page advising them that a site requires a current version of IE using a "IF IE" statement?And thank you thescientist, I did understand your explanation.

Link to comment
Share on other sites

Yeah. There is such a statement. The same one that is used to insert the hover.htc script:

<!--[if lt IE 7]><meta http-equiv="Refresh" content="1;http://microsoft.com/ie/" /><![endif]-->

As you can see, this time we're inserting a meta element. This meta element will redirect the user to he IE site at Microsoft, where they can download IE8.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...