keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 247 forks source link

:target not working in IE8 #91

Open ghost opened 9 years ago

ghost commented 9 years ago

I have a mobile responsive menu with submenus, which uses :target for the Tab feature on smaller screens: A click on the menu toggle will expand / collapse the menu.

@media only screen and (max-width: 768px) {

  #menu:target .show {
    display: none;
  }

  #menu:target .hide, #menu:target .menu-items {
    display: inline-block;
    line-height: 75px;
  }

}

As :target is only partially supported in Internet Explorer 8, I wanted to use Selectivizr, which I added after my CSS-stylesheets in the head like so:

<!--[if (gte IE 6)&(lte IE 8)]>
        <script type="text/javascript" src="selectivizr.js"></script>
<![endif]-->

(tried both version: 1.0.2 and 1.0.3b)

However, it does not work. The menu does not expand.

Any idea what is wrong?