2013-02-22 2 views
0

개발자들, 나는 모든 것을 반복해서하고 fancybox 플러그인이 작동을 거부하는 이유를 찾을 수 없을 것입니다. 내 생각에 아래 자바 스크립트는 플러그인을 실행한다고 가정합니다.Fancybox가 간단한 링크로 작동하지 않습니다.

<script type="text/javascript"> 
$(document).ready(function() { 

    /* This is basic - uses default settings */ 

    $("a#contactus").fancybox(); 

    /* Using custom settings */ 

    $("a#inline").fancybox({ 
     'hideOnContentClick': true 
    }); 

    /* Apply fancybox to multiple items */ 

    $("a.group").fancybox({ 
     'transitionIn' : 'elastic', 
     'transitionOut' : 'elastic', 
     'speedIn'  : 600, 
     'speedOut'  : 200, 
     'overlayShow' : false 
    }); 

}); 
</script> 
+0

[Fancybox는 jQuery v1.9.0과 호환되지 않습니다. \ [f.browser는 정의되지 않았으며 'msie'\] 속성을 읽을 수 없습니다.] (http://stackoverflow.com/questions/14344289/fancybox-doesnt -work-with-jquery-v1-9-0-f-browser-is-undefined-can not-read) – JFK

+0

해결 방법 http://stackoverflow.com/a/14344290/1055987 – JFK

답변

0

콘솔 (F12)을 열고 오류를 확인하십시오.

Fancybox는 jQuery 1.9에서 제거 된 $.browser을 사용하는 것 같습니다. 오류입니다!

또한 $("a#contactus").fancybox();은 오류입니다. 그런 요소는 없지만 ID가있는 div가 있습니까?

+0

그래서 jquery의 버전 – Jes

+0

예 div가 있지만 사이트에 갈 때 흰색 버튼을 클릭해야합니다 – Jes

+0

div가 아닌 해당 ID를 사용하여 앵커를 타겟팅하고 있습니다. jQuery의 경우 1.9 이전 버전이 필요하거나 fancybox에 최신 버전이 있고 1.9와 호환되는지 확인하거나 [browser shim]을 사용하십시오 (http://greatwebguy.com/jquery-2/browser-detection -shim-for-jquery-1-9 /). – adeneo

관련 문제