2012-02-13 2 views
-1

라이트 박스를 내 갤러리에서 실행하려고합니다. Jquery는 함수에서 alert()을 테스트하여 작동합니다. 하지만 라이트 박스는 작동하지 않는 것 같습니다. 아니면 적어도 링크가 정상적으로 작동합니다. 여기 내 코드는 다음과 같습니다.라이트 박스가 작동하지 않습니다. jquery가로드되었습니다.

<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">  
<head>  

<title></title>  
<meta charset="UTF-8" />  
<meta name="ROBOTS" content="ALL" />  
<meta name="MSSmartTagsPreventParsing" content="true" />  

<meta name="keywords" content="" />  
<meta name="description" content="" />  

<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>  

<link href="/fuelcms/assets/css/klang.css?c=943916400" media="all" rel="stylesheet"/>  

<base href="http://localhost/fuelcms/index.php" />  

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />  
<meta name="robots" content="index, follow" />  

<script type="text/javascript" src="assets/js/jquery.js"></script>  
<script type="text/javascript" src="assets/js/lightbox/prototype.js"></script>  
<script type="text/javascript" src="assets/js/lightbox/scriptaculous.js?load=effects,builder"></script>  
<script type="text/javascript" src="assets/js/lightbox/lightbox.js"></script>  
<link rel="stylesheet" href="assets/css/lightbox.css" type="text/css" media="screen" />  

</head>  


<body class="gallery index">  
<!--<div class="header"><ul>  
<li class="first"><a href="http://localhost/fuelcms/index.php/repertoire" title="Repertoire">Repertoire</a></li>  
<li><a href="http://localhost/fuelcms/index.php/about" title="&Uuml;ber uns">&Uuml;ber uns</a></li>  
<li><a href="http://localhost/fuelcms/index.php/kontakt" title="Kontakt">Kontakt</a></li>  
<li><a href="http://localhost/fuelcms/index.php/agenda" title="Agenda">Agenda</a></li>  
<li><a href="http://localhost/fuelcms/index.php/gallery" title="Gallerie">Gallerie</a></li>  
<li class="last"><a href="http://localhost/fuelcms/index.php/links" title="Links">Links</a></li>  
</ul>  
</div>-->  

<ul>  
<li class="first"><a href="http://localhost/fuelcms/index.php/repertoire" title="Repertoire">Repertoire</a></li>  
<li><a href="http://localhost/fuelcms/index.php/about" title="&Uuml;ber uns">&Uuml;ber uns</a></li>  
<li><a href="http://localhost/fuelcms/index.php/kontakt" title="Kontakt">Kontakt</a></li>  
<li><a href="http://localhost/fuelcms/index.php/agenda" title="Agenda">Agenda</a></li>  
<li><a href="http://localhost/fuelcms/index.php/gallery" title="Gallerie">Gallerie</a></li>  
<li class="last"><a href="http://localhost/fuelcms/index.php/links" title="Links">Links</a></li>  
</ul>  

<div class="fullpage">  
<div class="colmask">  
<div class="col3">  

<div class="pagination"><a href="http://localhost/fuelcms/index.php/gallery/index/">&lsaquo; First</a>&nbsp;&nbsp;<a href="http://localhost/fuelcms/index.php/gallery/index/7">&lt;</a>&nbsp;<a href="http://localhost/fuelcms/index.php/gallery/index/6">7</a>&nbsp;<a href="http://localhost/fuelcms/index.php/gallery/index/7">8</a><strong>9</strong></div><br><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Gong.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Gong_thumb.jpg" alt=""/></a></div><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Fatamorganaschatten.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Fatamorganaschatten_thumb.jpg" alt=""/></a></div><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Bumentopf2.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Bumentopf2_thumb.jpg" alt=""/></a></div><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Blumentopfdynamik.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Blumentopfdynamik_thumb.jpg" alt=""/></a></div><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Blumentopf.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Blumentopf_thumb.jpg" alt=""/></a></div><div class="imagebox"><a rel="lightbox[col]" href="assets/images/fotos_site/Blument1.JPG"><img src="http://localhost/fuelcms/assets/images/fotos_site/thumbs/Blument1_thumb.jpg" alt=""/></a></div></div></div><div class="footer" />  
</body>  
</html> 

나는 또한 head 태그의 스크립트 태그로 시도했지만 차이점이 없습니다.

greez

+1

Are 스크립트 태그 안의 숫자는 의도적입니까? – rcdmk

+3

왜 이전 버전을 사용하고 계십니까? [라이트 박스 2.05] (http://lokeshdhakar.com/projects/lightbox2/#download) 꽤 오랫동안 외출 중이었습니다 ... 아니면 다른 플러그인에 대해 이야기하고 있습니까? – elclanrs

+0

당신은 at 기호를 제거하려고 했습니까 ??? $ ('[rel * = lightbox]'). lightBox(); –

답변

3
  • 당신이 XHTML에서 코딩 almightybob (자동 폐쇄 태그를 사용)하지만 XHTML의 문서 타입을 선언하지.

  • <link>, <meta><base> 자체는 자기 닫는 SO에 this question을 확인하지만 <script> 관계없이 항상 외부 또는 내부의 경우, 안전 대책을위한 </script>하여 종료한다. 내 IDE (Aptana Studio 3)은 그런 식으로합니다 (내장 된 유효성 검사가 있다는 것을 알기에 제 의견으로는 "우수 사례"여야합니다)

  • 을 생략 할 수 있다고 생각합니다. 최신 jQuery를 사용하는 라이트 박스 : $('a[rel*=lightbox]').lightBox()

  • 얼마나 오래 되었습니까? 더 최근의 jQuery 버전을 사용해보십시오! 및 종료 body 태그 전에 다음과 같은 권리를 넣어 그것을 해결하기 전에이 문제를 했어

1

: 당신을 도울 것입니다

어쩌면
<script> 
    $.noConflict(); 
</script> 

.

참고 : 이는 Google의 CDN에서 호스팅되는 최신 jQuery (1.7.1) 및 Lightbox 2.05 located here을 사용하여 저에게 효과적입니다. 다른 라이트 박스 구현을 사용하고 있습니까? 그렇지 않다면, jQuery와 Lightbox의 아주 오래된 버전을 확실히 가지고 있습니다.

+0

Snipped가 diffrence를 만들거나하지 않고 만들었습니다. 감사합니다. – almightyBob

관련 문제