views:

29

answers:

2

I am having a problem with IE7 in a certain page where URL has katoder, http://www.mywebsite.com/Kalde_katoder.asp

I want to add a class ie7 to id system.

I tried this but it does not work.

Could anyone point me to the right direction?

Thanks in advance.

<!--[if IE 7]>

<script type="text/javascript">

$(document).ready(function() {
if(location.pathname.indexOf('katoder') > 0){
    $('#system').addClass('ie7');
}
});

</script>

<![endif]-->
+2  A: 

jQuery.browser Can Do the job

   $(function() {
      if($.browser.msie && parseInt($.browser.version) == 7) {
        if(location.pathname.indexOf('katoder') > 0){
            $('#system').addClass('ie7');
         }
      }
    });
Ninja Dude
A: 

Not sure what you're trying to do, but you probably don't need to use JavaScript. See http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/

Next, target your div with the ie7 class.

ehynds