2016-11-29 2 views
0

라이트 박스를 사용하고 싶지만 제대로 작동하지 않습니다. 나는 모든 것을 시도했다. 좋은 버전, 최종 본문 태그의 스크립트 등 포함 : lightbox.css, lightbox.js, jquery-1.7.2.js 아이콘이 보이지 않지만 표시되어 있습니다. head 섹션에서 jquery를 사용하여 lightbox.js를 사용할 때 여전히 작동하지 않습니다. 나는 좋은 길을 가고 있다고 생각한다.아이콘이없는 라이트 박스

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> 
    <meta name="Description" content="blablabla" /> 
    <meta name="Keywords" content="blablabla" /> 
    <title>blablabla</title> 
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,900&amp;subset=latin-ext" rel="stylesheet"> 
    <link rel="stylesheet" href="indexStyle.css" type="text/css"/> 
    <link href="lightbox.css" rel="stylesheet"> 
    <script type="text/javascript" src="jquery-1.7.2.js"></script> 
    <script type="text/javascript" src="lightbox.js"></script> 
    <script type="text/javascript" src="banner.js"></script> 

</head> 
<body onload="zmienslajd();"> 
<div class="backgroundContainer"> 
    <div class="container"> 
     <div class="upContainer"> 
      <div class="logo"> 
       <a href="blablabla"><img src="models/logo.png" alt="Przepraszamy - awaria logo." /></a> 
      </div> 
      <div class="nav"> 
       <ol> 
        <li><a href="blablabla2"></a></li> 
        <li><a href="#">Oferta</a></li> 
        <li><a href="blablabla3">Gallery</a></li> 
        <li><a href="blablabla4"></a></li> 
       </ol> 
      </div> 
     </div> 
     <div style="clear: both"></div> 
     <div id="banner"> 

     </div> 
     <div style="clear: both"></div> 
     <div class="midContainer"> 
      <a href="Models/galeria1.jpg" data-lightbox="roadtrip"><img src="Models/mingaleria1.jpg" alt="Zdjęcie 1"></a> 
      <a href="Models/galeria2.jpg" data-lightbox="roadtrip"><img src="models/mingaleria2.jpg" alt="Zdjęcie 2"></a> 
      <a href="Models/galeria3.jpg" data-lightbox="roadtrip"><img src="models/mingaleria3.jpg" alt="Zdjęcie 3"></a> 
      <a href="Models/galeria4.jpg" data-lightbox="roadtrip"><img src="models/mingaleria4.jpg" alt="Zdjęcie 4"></a> 
      <script type="text/javascript" src="lightbox.js"></script> 
     </div> 
     <div style="clear: both"></div> 
     <div class="botContainer"> 
      Time4Fruit.pl &copy; 2016 by blablabla 
     </div> 
     <div style="clear: both"></div> 
    </div> 
</div> 
<script type="text/javascript" src="lightbox.js"></script> 
</body> 
</html> 

내 CSS :

/* Preload images */ 
body:after { 
    content: url("images/close.png") url("images/loading.gif") url("images/prev.png") url("images/next.png"); 
    display: none; 
} 
body.lb-disable-scrolling { 
    overflow: hidden; 
} 
.lightboxOverlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 9999; 
    background-color: black; 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); 
    opacity: 0.8; 
    display: none; 
} 
.lightbox { 
    position: absolute; 
    left: 0; 
    width: 100%; 
    z-index: 10000; 
    text-align: center; 
    line-height: 0; 
    font-weight: normal; 
} 
.lightbox .lb-image { 
    display: block; 
    height: auto; 
    max-width: inherit; 
    max-height: none; 
    border-radius: 3px; 
    /* Image border */ 
    border: 4px solid white; 
} 
.lightbox a img { 
    border: none; 
} 
.lb-outerContainer { 
    position: relative; 
    *zoom: 1; 
    width: 250px; 
    height: 250px; 
    margin: 0 auto; 
    border-radius: 4px; 
    /* Background color behind image. 
    This is visible during transitions. */ 
    background-color: white; 
} 
.lb-outerContainer:after { 
    content: ""; 
    display: table; 
    clear: both; 
} 
.lb-loader { 
    position: absolute; 
    top: 43%; 
    left: 0; 
    height: 25%; 
    width: 100%; 
    text-align: center; 
    line-height: 0; 
} 
.lb-cancel { 
    display: block; 
    width: 32px; 
    height: 32px; 
    margin: 0 auto; 
    background: url("images/loading.gif") no-repeat; 
} 
.lb-nav { 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 100%; 
    width: 100%; 
    z-index: 10; 
} 
.lb-container > .nav { 
    left: 0; 
} 
.lb-nav a { 
    outline: none; 
    background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); 
} 
.lb-prev, .lb-next { 
    height: 100%; 
    cursor: pointer; 
    display: block; 
} 
.lb-nav a.lb-prev { 
    width: 34%; 
    left: 0; 
    float: left; 
    background: url("images/prev.png") left 48% no-repeat; 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); 
    opacity: 0; 
    -webkit-transition: opacity 0.6s; 
    -moz-transition: opacity 0.6s; 
    -o-transition: opacity 0.6s; 
    transition: opacity 0.6s; 
} 
.lb-nav a.lb-prev:hover { 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 
    opacity: 1; 
} 
.lb-nav a.lb-next { 
    width: 64%; 
    right: 0; 
    float: right; 
    background: url("images/next.png") right 48% no-repeat; 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); 
    opacity: 0; 
    -webkit-transition: opacity 0.6s; 
    -moz-transition: opacity 0.6s; 
    -o-transition: opacity 0.6s; 
    transition: opacity 0.6s; 
} 
.lb-nav a.lb-next:hover { 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 
    opacity: 1; 
} 
.lb-dataContainer { 
    margin: 0 auto; 
    padding-top: 5px; 
    *zoom: 1; 
    width: 100%; 
    -moz-border-radius-bottomleft: 4px; 
    -webkit-border-bottom-left-radius: 4px; 
    border-bottom-left-radius: 4px; 
    -moz-border-radius-bottomright: 4px; 
    -webkit-border-bottom-right-radius: 4px; 
    border-bottom-right-radius: 4px; 
} 
.lb-dataContainer:after { 
    content: ""; 
    display: table; 
    clear: both; 
} 
.lb-data { 
    padding: 0 4px; 
    color: #ccc; 
} 
.lb-data .lb-details { 
    width: 85%; 
    float: left; 
    text-align: left; 
    line-height: 1.1em; 
} 
.lb-data .lb-caption { 
    font-size: 13px; 
    font-weight: bold; 
    line-height: 1em; 
} 
.lb-data .lb-caption a { 
    color: #4ae; 
} 
.lb-data .lb-number { 
    display: block; 
    clear: left; 
    padding-bottom: 1em; 
    font-size: 12px; 
    color: #999999; 
} 
.lb-data .lb-close { 
    display: block; 
    float: right; 
    width: 30px; 
    height: 30px; 
    background: url("images/close.png") top right no-repeat; 
    text-align: right; 
    outline: none; 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); 
    opacity: 0.7; 
    -webkit-transition: opacity 0.2s; 
    -moz-transition: opacity 0.2s; 
    -o-transition: opacity 0.2s; 
    transition: opacity 0.2s; 
} 
.lb-data .lb-close:hover { 
    cursor: pointer; 
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 
    opacity: 1; 
} 
+0

왜 스크립트를 머리에로드합니까? 모든 JS 스크립트를 페이지의 맨 아래로 옮기십시오. ''닫는 태그 –

+0

의 파일 경로가 잘못되었을 가능성이 있습니다. – kayee

+0

경로가 정확하다고 생각합니다. 나는 그것을 검사했다. Sebastian Kaczmarek는 오류가 있지만 데이터 라이트 박스에서 경고를 보았습니다. 설명 : 속성 데이터 라이트 박스는 여기에서 허용되지 않습니다. 이 검사는 알 수없는 HTML 태그 속성을 유효하지 않은 것으로 강조 표시하고 이러한 속성을 Custom으로 표시하여 해당 태그를 invalid.hm으로 강조하지 않도록합니다. 이 경고를 어떻게 수정합니까? –

답변

0

를 해결.
<link href="lightbox.css" rel="stylesheet">이 잘못되었습니다.
은 다음과 같아야합니다

<link href="css/lightbox.css" rel="stylesheet" type="text/css"/> 

UFF. 이제 맞습니다!

+0

그리고 3 개의 파일이있을 때 올바른데 : js lightbox.ja, css lightbox.css 및 이미지 아이콘. –