window.onload 이벤트에서 colorbox 플러그인으로 iframe을 열어야합니다. 나는 거의 성공을 거두고 있지만 이상한 일이 일어나기 시작했다. 보자 - 내가 위의 예제는 제대로 작동을 보여jQuery colorbox가 이상하게 실패합니다.
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the Colorbox event to elements
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%", closeButton:false, escKey: false, overlayClose: false, opacity:0.30});
});
window.onload=function(){
$(".iframe").colorbox({href:"http://www.website.com/", open: true});
}
</script>
</head>
<body>
<p><a class='iframe' href="http://wikipedia.com"></a></p>
</body>
</html>
참고 몸에 내가 가지고 :이 줄을 제거하면
< p>< a class='iframe' href="http://wikipedia.com">< /a>< /p>
가 iframe을 더 이상 열리지 않습니다. 나는 jquery에 초보자 다. 그래서 나를 위해 이것은 의미가 없다. 그리고 나는 '감각이없는'것들로 일하고 싶지 않습니다. 너희들이 올바른 방식으로 작동하게하는 방법을 더 잘 설명해 주시겠습니까?
의 jQuery 선택기에 대해 검색하십시오 ... 당신은 colorbox이 Uhmm ... 그것은 작동하지 않습니다 – JoDev