2016-10-16 4 views
-1

내 페이지에서 이미지가 아직 업로드되지 않았거나 오류로 인해 삭제되어 경고를 삭제하거나 숨길 수있는 대상을 찾고 있습니다. ? 내 IMG의 SRC를 찾을 수 없습니다에 대한

여기 또는이 링크에 내 코드를 확인하실 수 있습니다 -> 여기

http://www.booclin.ovh/tom/2/

내 코드입니다

$("img").error(function() { 
 
    $(this).parent().remove(); 
 
}); 
 

 
$("a.fancyboxgallery").fancybox();
<link href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css" rel="stylesheet" /> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.js"></script> 
 

 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/6.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/06.jpg" alt=""/> 
 
</a> 
 
    
 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/5.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/05.jpg" alt=""/> 
 
</a> 
 
    
 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/4.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/04.jpg" alt=""/> 
 
</a> 
 
    
 

 
    
 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/3.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/03.jpg" alt=""/> 
 
</a> 
 
    
 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/2.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/02.jpg" alt=""/> 
 
</a> 
 
    
 
<a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/1.jpg" title=""> 
 
<img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/01.jpg" alt=""/> 
 
</a>

답변

0

콘솔에있는 오류 : $ is not defined 의미 jQuery가로드되지 않았습니다.

너는 <body> 안에 <div class="rightpart"> 안에로드합니다.

한번에 로딩 그것을 <head> 직전에 :

<html lang="en" class="js backgroundsize"><!--<![endif]--> 
    <head> 
     <meta charset="UTF-8"> 
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1, minimum-scale=1, maximum-scale=1.0"> 
     <meta name="apple-mobile-web-app-capable" content="yes"> 

     <link property="stylesheet" rel="stylesheet" type="text/css" href="index/css/style.css" class="--apng-checked"> 

     <link property="stylesheet" rel="stylesheet" type="text/css" href="index/font/font.css" class="--apng-checked"> 

     <link rel="stylesheet" type="text/css" media="screen" href="index/css/jquery.fancybox.css" class="--apng-checked"> 

     <link rel="stylesheet" media="screen" href="index/js/jquery.fancybox.css" type="text/css" class="--apng-checked"> 

     <script type="text/javascript" src="index/js/jquery.fancybox.js"></script> 

     <script type="text/javascript" src="index/js/fancybox.js"></script> 

     <style type="text/css" class="--apng-checked">.fancybox-margin{margin-right:0px;}</style> 
    </head> 

    <body> 

     <div class="leftpart"> 
      <a href="#">PROJECT</a> 
     </div> 

     <div class="rightpart"> 
      <div id="globalgalerie"> 


       <a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/3.jpg" title=""> 
       <img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/03.jpg" alt=""> 
       </a> 

       <a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/2.jpg" title=""> 
       <img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/02.jpg" alt=""> 
       </a> 

       <a class="fancyboxgallery" rel="book" href="http://www.booclin.ovh/tom/2/index/photos/projet/1.jpg" title=""> 
       <img class="fancyboxthumbnailsgallery" src="http://www.booclin.ovh/tom/2/index/photos/projet/01.jpg" alt=""> 
       </a> 
      </div> 
     </div> 

     <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script> 

     <script type="text/javascript" src="index/js/modernizr.custom.js"></script> 

     <script type="text/javascript" src="index/js/jquery.fancybox.js"></script> 

     <script type="text/javascript" src="index/js/fancybox.js"></script> 

     <script type="text/javascript"> 
      $("img").error(function() { $(this).parent().remove(); }); 
      $("a.fancyboxgallery").fancybox(); 
     </script> 

    </body> 
</html> 

그래서 무슨 뜻인지 : 여기

당신의 HTML이 라이브 링크의 코드 관리자에 대한 복사 <script type="text/javascript" src="index/js/jquery.fancybox.js"></script>

편집 <head> 섹션에서이 줄을 이동하는 것입니다.

<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script> 

<script type="text/javascript" src="index/js/modernizr.custom.js"></script> 

<script type="text/javascript" src="index/js/jquery.fancybox.js"></script> 

<script type="text/javascript" src="index/js/fancybox.js"></script> 

이 항목은 이미 <head>에 있습니다 ... 복제 할 필요가 없습니다.

<script type="text/javascript" src="index/js/jquery.fancybox.js"></script> 

<script type="text/javascript" src="index/js/fancybox.js"></script> 

오류 기능은 <body> 끝에 있습니다.

+0

이전에 coolio83000

+0

내 편집 된 답변보기 ;) –

+0

죄송합니다. 내 파일이 내 페이지에 복제 된 이유는 무엇입니까?!?! 내가 그들을 제거했지만 오류가 여전히 존재한다 (당신은 내 페이지를 모두 확인 할 수 있습니다 여기에 확인 -> http://www.booclin.ovh/tom/2/index.html – coolio83000

관련 문제