没有图标的灯箱

时间:2016-11-29 21:11:40

标签: javascript jquery html css lightbox

我想使用灯箱,我做了但不起作用。 我尝试了一切。好的版本,最终身体标签上的脚本等。 包括: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;
}

1 个答案:

答案 0 :(得分:0)

解决。
<link href="lightbox.css" rel="stylesheet">是错误的。
应该是:

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

UFF。现在是对的!