저는 매우 새로운 기능입니다. 누군가가 올바른 방향으로 나를 가리킬 수 있습니까?.bind() .live()는 Safari 나 Chrome에서는 작동하지 않지만 Firefox에서는 작동합니다.
파이어 폭스에서 원하는 방식으로 웹 사이트를 운영하고 있지만 Safari 나 Chrome에서 테스트 해보니 작동하지 않습니다. 나중에 더 많은 문제가있을 것이라고 확신하지만 첫 번째 문제는 내 주요 탐색 버튼이 작동하지 않는다는 것입니다. 클릭 핸들러 및 mouseleave
및 mouseenter
이 작동하지 않습니다.
이 코드에 문제가 있습니까? 아니면 다른 곳에서 문제가 될 수 있습니까?
function onLoad() {
var $list= $('#mainNavList');
showMainMenu(); //make menus appear
specifyScrollingElement('#mainNavList');
specifyScrollingElement('#lowerNav');
$list.find('.linkInactive').live('click', onMainNavMenuClick);
$('.albumLink').parent().bind('mouseenter',function(){
$(this).css({'background-color': '#fff'});
});
$('.albumLink').parent().bind('mouseleave',function(){
if ($(this).hasClass('current')==false){
$(this).css({'background-color': 'rgba(233,229,194,.9)'});
};
});
$('.textLink').parent().bind('mouseenter',function(){
$(this).css({'background-color': 'rgba(65,65,65,.8)'});
});
$('.textLink').parent().bind('mouseleave',function(){
if (portfoliosActive ==false && $(this).children().hasClass('portfolioButton')==true){
$(this).css({'background-color': 'transparent'});
};
if (portfoliosActive ==true && $(this).children().hasClass('homeButton')==true){
$(this).css({'background-color': 'transparent'});
};
});
$list.find('.linkActive').live('click',function(){
var $this = $(this);
$this.addClass('linkInactive').removeClass('linkActive');
hideThumbs($list);
});
thumbnailActions('#mainNavList');
thumbnailActions('#lowerNav');
initUpperNavActions();
}
훌륭한 아이디어는 http://jsfiddle.net/ 또는 이와 유사한 샌드 박스 영역에서 샘플을 작동시키는 것입니다. 이렇게하면 무사히 프레임 워크 버전을 변경할 수 있습니다. –
Joe에게 감사 드려요. 그것은 지금 내 머리 위에있다. js fiddle이란 무엇이며 프레임 워크는 무엇입니까? jquery는 프레임 워크인가? – user3558189
예 jQuery는 자바 스크립트로 작성된 프레임 워크입니다. :) jsFiddle : http://www.techrepublic.com/blog/software-engineer/jsfiddle-an-online-playground-for-your-javascript-html-css/#. –