2012-02-23 4 views
2

저는 jQuery의 문법에 익숙하지 않습니다. 그리고 이것은 아마도 진짜 noobie 질문 일 것입니다.하지만이 페이지를로드 할 때 "$ .effects가 정의되지 않았습니다."라는 오류가 나타나는 이유를 모르겠습니다. 사람이 볼 수 있다면, 훨씬 의무가 될 것이다 ... TIA, rixter

<!doctype html> 
<html> 
    <head> 
    <script type="text/javascript" src="jquery-1.7.1.min.js"></script> 
    <script src="./development-bundle/ui/jquery.ui.core.js"></script> 
    <script src="./development-bundle/ui/jquery.effects.pulsate.js"></script> 


    <script type="text/javascript"> 
    $(document).ready(function(){ 
     $("a").click(function(event){ 
      //alert("Thanks for visiting!"); 
     }); 
     });  

    function runEffect() { 
     $("pulsate").effect(selectedEffect, options, 500, callback); 
    } 

    // bind button to click event 
    $("#button").click(function() { 
    alert("Running effect..."); 
    runEffect(); 
    return false; 
    }); 

    // callback function to bring a hidden box back 
    function callback() { 
     setTimeout(function() { 
    $("#effect").removeAttr("style").hide().fadeIn(); 
     }, 1000); 
    };  

    </script> 

    </head> 
    <body> 
    <a href="http://jquery.com/">jQuery</a> 
    <div id=effect> 
     Show effects here... 
    </div> 
    <a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a> 


    </body> 
</html> 
+0

포함하려는 스크립트가 있습니까? 즉, jquery.effects.pulsate.js 파일입니다. 나는 분명히 실행중인 라이브러리에서 라이브러리가 누락 된 것처럼 보입니다. – Furbeenator

답변

2

내가 $.effects 핵심 jQuery를 패키지에 포함되어 있지 않습니다 jQuery를 UI의 일부 믿습니다. http://jqueryui.com/docs/Effects/Methods

the jQuery UI site에 jQuery UI 패키지를 사용자 정의하고 다운로드 한 다음 jQuery 이후 페이지에 별도의 <script> 태그로 포함시킬 수 있습니다. Plusate 효과는 다음과 같은 방법으로 이루어집니다

+0

와우, 모두 감사합니다 ... 나는 내가로드해야하는 누락 된 파일을 발견했다는 것을 게시 할 예정이었습니다 ... 그리고 3 개의 게시물이 이미 나타났습니다! 내 문제를 해결하기 위해 모든 사람의 정보를 고려할 것입니다 .... StackOverflow rocks! – rixter

4

또한

를 ./development-bundle/ui/jquery.effects.core.js로드해야합니다

방금 ​​시작한 경우 개별 개발 번들 파일 대신 jQuery UI 정식 버전을로드하는 것이 좋습니다. 의존성을 수동으로 파악하는 것은 작동 방법을 알고있을 때에도 고통스런 일입니다.

관련 문제