2012-04-14 3 views
0

둥근 모서리를 사용하여 내 meny에서 크로스 브라우저 롤오버 효과를 코딩하려고하지만 ie에서 작동하지 않습니다. 나는 PIE를 심지어 약간의 pllugins로 사용하려고 노력하고 있었다. 그러나 그들은 일을 didnt한다.예 : jquery와 둥근 모서리를 사용하여 예 :

$("document").ready(function() { 

var ancho = $('nav li.nav_active').width()+24; 

    $('nav li.nav_active').css({ 
      'background-color' : '#282828', 
      "height" : ancho+"px", 
      'margin-top' : "-"+(ancho-48)/2+"px", 
      '-moz-border-radius' : ancho/2+"px", 
      '-webkit-border-radius' : ancho/2+"px", 
      '-khtml-border-radius' : ancho/2+"px", 
      'border-radius' : ancho/2+"px", 
      'behavior' : 'url(../PIE.htc)', 
      '-webkit-box-shadow' : '0 8px 6px -6px black', 
      '-moz-box-shadow' : '0 8px 6px -6px black', 
      'box-shadow' : '0 8px 6px -6px black', 
      'border' : 'none' 
      }); 
      $('nav li.nav_active a').css({ 
      "line-height" : ancho+"px", 
      "color" : "white", 
      "font-family" : "'E-BoldCondensed'", 
      }); 






$(function() { 
    $('nav li:not(.nav_active)').mouseover(
     function() { 
      var ancho = $(this).width()+32; 
      $(this).css({ 
      "height" : ancho+"px", 
      'margin-top' : "-"+(ancho-48)/2+"px", 
      '-moz-border-radius' : ancho/2+"px", 
      '-webkit-border-radius' : ancho/2+"px", 
      '-khtml-border-radius' : ancho/2+"px", 
      'border-radius' : ancho/2+"px", 
      'behavior' : 'url(../PIE.htc)', 
      '-webkit-box-shadow' : '0 8px 6px -6px black', 
      '-moz-box-shadow' : '0 8px 6px -6px black', 
      'box-shadow' : '0 8px 6px -6px black', 
      }); 
      $(this,'a').css({ 
      "line-height" : ancho+"px", 
      }); 
     }); 
}); 

$(function() { 
    $('nav li:not(.nav_active)').mouseleave(
     function() { 

      $(this).css({ 
      "height" : "", 
      'margin-top' : "", 
      '-moz-border-radius' : "", 
      '-webkit-border-radius' : "", 
      '-khtml-border-radius' : "", 
      'border-radius' : "", 
      '-webkit-box-shadow' : '', 
      '-moz-box-shadow' : '', 
      'box-shadow' : '', 

      }); 
      $(this,'a').css({ 
      "line-height" : '', 
      }); 
     }); 
}); 

$(function() { 
    $('nav li').mousedown(
     function() { 
      var ancho = $(this).width()+32; 
      $(this).css({ 
      "height" : ancho+"px", 
      'margin-top' : "-"+(ancho-48)/2+"px", 
      '-moz-border-radius' : ancho/2+"px", 
      '-webkit-border-radius' : ancho/2+"px", 
      '-khtml-border-radius' : ancho/2+"px", 
      'border-radius' : ancho/2+"px", 
      'behavior' : 'url(../PIE.htc)', 
      '-webkit-box-shadow' : '', 
      '-moz-box-shadow' : '', 
      'box-shadow' : '', 
      }); 
      $(this,'a').css({ 
      "line-height" : ancho+"px", 
      }); 
     }); 
}); 

}); 

이 내 웹 사이트의 링크 :

내 코드입니다 www.miramarlab.com

+1

은 왜 그냥 수업 시간에 모든 것을 넣어''CSS 대신'의 addClass()을 (사용하지 않는)'?? – elclanrs

+0

어떤 버전의 IE입니까? JS와는 달리 정적으로 PIE 모서리를 설정하려 했습니까? 나는 PIE가 동적으로 추가 된 CSS에서 작동하지 않는다고 확신합니다. –

+0

완벽 한 원을 만들기 위해 모서리 반경을 계산하기 위해 li의 너비 값을 가져와야하기 때문에 css()를 사용하고 있습니다. –

답변

0

htc 파일은 css가 아닌 html 페이지와 관련하여 호출해야합니다. htc 파일에는 .htaccess 파일에 추가해야하는 특정 MIME 유형이 있습니다.

루트 디렉토리에 HTC 파일을 저장하고 절대 경로로로드 :

behavior: url (http://www.miramarlab.com/PIE.htc);