Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts

    Lightbulb How to get :hover commands for any element in IE

    :::WAIT:::

    before you judge this thread by the title (although thats usually a good thing to judge it by) let me say this: I am NOT asking how to do this. I am telling you about a way that you can apply the hover psuedo thing to ANY element in IE!!!

    (You may all know this already, you people are so smart)

    I just found an .htc file on this site: http://www.xs4all.nl/~peterned/csshover.html that allows you to apply the hover psuedo class to any element.

    all you do is upload it to your server and then add the following line in your <body> tag:
    Code:
    style="behavior:url(csshover.htc)"
    or you can probably put it in css, but I wasnt sure how.

    Dan
    Last edited by whizard; 02-11-2005 at 04:24 PM. Reason: forgot to put code box in, also rename title
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #2
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by whizard
    all you do is upload it to your server and then add the following line in your <body> tag:
    Code:
    style="behavior:url(csshover.htc)"
    or you can probably put it in css, but I wasnt sure how.
    This would probably be the best way to do it:
    Code:
    <!--[if IE]>
    <style type="text/css">
    body {
    behavior: url(csshover.htc);
    }
    </style>
    <[end if]-->
    The "behavior" attribute is not valid CSS, so if you use conditional comments the page will still validate.

    I now have 666 posts . It's the devil!

  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    It doesnt matter if the browser is IE or not. Other browsers dont support htc behaviors

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #4
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by whizard
    It doesnt matter if the browser is IE or not. Other browsers dont support htc behaviors
    That wasn't the point I was making - the "behavior" attribute is not valid CSS, so unless you use the condtional comments, the page will not validate.

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    oh. i get it.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    I've read that article, but I've never tried it out because of this bit:

    NOTE: The rules for HTCs have changed a bit in Windows XP SP2. Users with SP2 installed may not see it working correctly, because webservers have to send htc files with the mime-type set to text/x-component.
    There's a link to a blog that documents it, but I never got that far... too busy sighing and moving on

    If you like that, you'll appreciate this link, too :

    http://www.doxdesk.com/software/js/minmax.html

    It's a great little JS bit that forces IE into supoorting min/max width and height.

    (this is actually a good idea for a new thread/sticky if you ask me... tools and hacks for IE)

  • #7
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rmedek
    If you like that, you'll appreciate this link, too :

    http://www.doxdesk.com/software/js/minmax.html

    It's a great little JS bit that forces IE into supoorting min/max width and height.
    Bookmarked .

  • #8
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    I have SP2 and am using Abyss Web Server to test on local, but I have not encountered any problems with this .htc file. It works on EVERYTHING. its awesome!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #9
    Zac
    Zac is offline
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hover for all elements in IE

    Hi,

    After implementing your suggested solution using the htc file, I found with <base href> on the page hover only works for clients coming into the site through that domain, e.g if <base href="xx.com"> and people enter my site through xx.co.uk then hover still does not work.

    I would be greatful if you could suggest any possible solutions.

    Many thanks for your help,

    Zac

  • #10
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Why not just drop <base> from the meta tags?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •