그래서 어떤 항목을 가리키고 있는지에 따라 확장 및 축소 메뉴를 설정하려고합니다. 나는 css 전환을 사용하여 확장 및 축소를 부드럽게하고 일부 jQuery를 사용하여 CSS 속성을 변경합니다. 그러나 IE는 전환 CSS를 지원하지 않으므로 jQuery로이를 수행하는 방법을 찾고 있지만 해결책을 찾지 못했습니다. 내 지식은 jQuery에 관해서 가장 중요하지 않습니다. 어떤 도움이라도 훌륭 할 것입니다.jQuery CSS 확장없이 메뉴 확장하기
<html>
<head>
<style>
.a{
width:100px;
height:100px;
background:#852369;
position:relative;
float:left;
-webkit-transition: width 1s ease;
-moz-transition: width 1s ease;
-o-transition: width 1s ease;
-ms-transition: width 1s ease;
transition: width 1s ease;
}
.b{
width:100px;
height:100px;
background:#542365;
position:relative;
float:left;
-webkit-transition: width 1s ease;
-moz-transition: width 1s ease;
-o-transition: width 1s ease;
-ms-transition: width 1s ease;
transition: width 1s ease;
}
.c{
width:100px;
height:100px;
background:#523641;
position:relative;
float:left;
-webkit-transition: width 1s ease;
-moz-transition: width 1s ease;
-o-transition: width 1s ease;
-ms-transition: width 1s ease;
transition: width 1s ease;
}
</style>
</head>
<body>
<div class="a">This is div a</div>
<div class="b">This is div b</div>
<div class="c">This is div c</div>
<script>
$(function() {
$('.a').hover(function() {
$('.b,.c').css('width', '50');
$('.a').css('width', '200');
}, function() {
$('.a,.b,.c').css('width', '');
}
);
$('.b').hover(function() {
$('.a,.c').css('width', '50');
$('.b').css('width', '200');
}, function() {
$('.a,.b,.c').css('width', '');
}
);
$('.c').hover(function() {
$('.a,.b').css('width', '50');
$('.c').css('width', '200');
}, function() {
$('.a,.b,.c').css('width', '');
}
);
});
</script
</body>
</html>
여기는 현재 내가 가지고있는 것의 단순한 jsfiddle입니다.
http://jsfiddle.net/kevin11189/kRZHL/1/
덕분에,
케빈
은 [이] (http://api.jquery.com/animate/) 당신은 무엇을 줄까? –
유사한 메뉴 효과가있는 사이트에 연결할 수 있으므로 달성하고자하는 것을 더 잘 볼 수 있습니까? –