-1
jQuery(document).ready(function(){ 

    jQuery(window).scroll(function(){ 
     if (jQuery(this).scrollTop() > 600) { 
      jQuery('.scrollup').fadeIn(); 
     } else { 
      jQuery('.scrollup').fadeOut(); 
     } 
     if(jQuery(this).scrollTop() < 600) { 
      jQuery('.scrolldown').fadeIn(); 
      }else { 
      jQuery('.scrolldown').fadeOut(); 
      } 
    }); 

    jQuery('.scrollup').click(function(){ 
     jQuery("html, body").animate({ scrollTop: 0 }, 900); 

     return false; 
    }); 
    jQuery('.scrolldown').click(function() { 
     jQuery("html, body").animate({ scrollTop: jQuery(document).height()-jQuery(window).height() }, 900); 
     return false; 
     }); 

}); 

Wordpress 사이트에서 페이지 스크롤러에 대해이 코드를 사용해 보았습니다. 라이브 사이트가 아닌 localhost에서 실행할 때 작동합니다. 라이브 사이트에서 작동하지 않는 이유는 무엇입니까?jQuery가 라이브 Wordpress 사이트에서 작동하지 않습니다.

내가 (방화범 통해) 자바 스크립트 콘솔에서이 오류를 얻을 : 당신의 선택은 지금까지 내가 말할 수있는

var store_cur_pos_top = $(".author_cont").offset().top; 

을 실패하고, 우선 들어

TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 

jquery.min.js (line 5) 
TypeError: invalid 'in' operand e 
[Break On This Error] 

...pe);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.node... 
+0

당신이 jQuery를 수입하고, 위의 코드가 문서에 표시되기 전에 그렇게하고 있습니까 :

여기

가 해결 Mootools의/jQuery를 충돌에 대한 유용한 게시물입니까? 브라우저 콘솔에 오류가 있습니까? – Pointy

+0

위의 스크립트를 사용하여 을 연결했고 또한 –

+0

의 오류가 발생했습니다. TypeError : invalid ' in 'operand e [이 오류 발생시 중단] \t ... pe); return e} x.each ({parent : function (e) {var t = e.parentNode; return t && 11! == t.node 기능 :; ... jquery.min.js (라인 5) 형식 오류 리턴 E} x.each ({상위 잘못된 피연산자 E '에서'는 \t ... 을 PE)이 오류 휴식] (e) {var t = e.parentNode; return t && 11! == t.node ... jquery.min.js (line 5) 유형 오류 : 'in'피연산자가 잘못되었습니다. [이 오류 발생시 중단] \t ... pe); return e} x.each ({parent : function (e) {var t = e.parentNode; return t && 11! = = t.node ... jquery.min.js (행 5) –

답변

1

, 어떤 인스턴스가 없습니다 techstumbling.com에 $ (". author_cont").

$('whois').addEvent('submit', function(e) { 

선택 $에 사용할 수있는 개체가 없습니다 ('후이즈') : 따라서, 귀하의 .offset() 호출에

같은 일을 실패합니다. ReLeaf가 언급했듯이, MooTools와 jQuery간에 충돌이있을 수 있습니다.

몇 가지 일반적인 조언. 이러한 선택기 문제를 해결하십시오. 부실 콘텐츠가 없는지 항상 캐시를 지우십시오. 이 문제로 시작하면 나머지는 더 분명해질 것입니다.

편집 : jQuery and MooTools Conflict

+0

Thanks @ David L 귀하의 제안에 감사 드리며 귀하의 소중한 시간을 써서 의심을 해결해주십시오. 많은 도움을 주셨습니다. –

+1

@vicky 환영합니다! 문제를 해결해 주셔서 감사합니다. –

관련 문제