0

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 Answers 2

2

jQuery.browser Can Do the job

   $(function() {
      if($.browser.msie && parseInt($.browser.version) == 7) {
        if(location.pathname.indexOf('katoder') > 0){
            $('#system').addClass('ie7');
         }
      }
    });
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.