그래서 jQuery에서 해당 목록의 활성 링크를 강조 표시하려는 정렬되지 않은 목록이 있습니다. mouseover와 mouseleave에 대한 목록에 애니메이션이있어서 링크가 움직일 때 글꼴 크기가 커집니다.jQuery를 사용하여 활성 요소 강조 표시
나는 mouseleave에서 .unbind를 사용하여 링크의 크기와 색상을 늘릴 수 있지만 링크를 다시 바인딩하려고하면 링크가 모두 강조 표시됩니다. 이것에 어떤 도움을 크게 감상 할 수
$(document).ready(function() {
slide("#sliding-navigation", 22, 17, 175, .8);
});
function slide(navigation_id, font_out, font_in, time, multiplier) {
// Creates the target paths
var list_elements = navigation_id + " li.sliding-element";
var link_elements = list_elements + " a";
// Initiates the timer used for the initial sliding animation
var timer = 0;
// Create the beginning slide animation
$(list_elements).each(function(i) {
// updates timer
timer = (timer*multiplier + time);
$(this).animate({ marginLeft: "0" }, timer);
$(this).animate({ marginLeft: "15px" }, timer);
$(this).animate({ marginLeft: "0" }, timer);
});
// Creates the hover effect
$(link_elements).each(function(i) {
$(this).mouseenter(function() {
$(this).animate({ fontSize: font_out }, 200);
}),
$(this).mouseleave(function() {
$(this).animate({ fontSize: font_in }, 400);
}),
// Highlights active link
$('a').click(function() {
$('a.active').bind('mouseleave');
$('a.active').addClass('inactive');
$('a.active').removeClass('active');
$(this).removeClass('inactive');
$(this).addClass('active');
$(this).unbind('mouseleave');
});
}
:
여기에 지금까지 내 코드입니다. 미리 제안 해 주셔서 감사합니다.크리스
가 도움이 응답 해 주셔서 감사합니다
은 여기가 변경 원래의 코드입니다! 이것은 여전히 다소 버그가 있지만 원하는 효과를 어느 정도 달성합니다. 내가 언급 한 "라이브"기능을 찾고 있는데 바인딩 및 바인딩 해제보다 사용하는 것이 더 좋을 것으로 보인다. 아직 모든 것을 이해하려고 노력하고 있습니다 .... 도움을 다시 한번 감사드립니다! –