Jquery is not a funciton (wordpress) 에러 발생시

Jquery is not a funciton (wordpress) 에러가 발생하는 이유는 이렇다.

워드프레스가 포함하고 있는 jquery.js 에 jQuery.noConflict() 때문

따라서 jquery 사용시 아래 예제 구문처럼 사용해야한다.

In WordPress jQuery.noConflict() is called on the jQuery file it includes (scroll to the bottom of the file it’s including for jQuery to see this), which means $ doesn’t work, but jQuery does, so your code should look like this:

<script type=”text/javascript”>
jQuery(function($) {
for(var i=0; i <= 20; i++)
$(“ol li:nth-child(” + i + “)”).addClass(‘olli’ + i);
});
</script>

즉,

$(document).ready(function(){  <== 이것을 사용하지 말고
jQuery(function($) { <== 이렇게 사용할것

 

참고: http://stackoverflow.com/questions/3931529/is-not-a-function-jquery-error

Continue Reading

Jquery 메뉴 네비게이션 및 쿠키관련

j2

[jQuery] Cookie 플러그인
http://nosmoke.cctoday.co.kr/628

cookie를 배열로 저장하기
http://blog.naver.com/PostView.nhn?blogId=mysk4521&logNo=40146622939

Simple JQuery Accordion menu
http://www.i-marco.nl/weblog/jquery-accordion-menu-redux2/

jQuery Concertina Menu Plugin with Cookies
http://www.inventpartners.com/content/jquery-concertina-menu-plugin

j1
jQuery TreeView Menu
http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm ★
http://www.dynamicdrive.com/dynamicindex1/treeview/demo/index.html (데모)

Continue Reading