【发布时间】:2014-10-31 12:33:42
【问题描述】:
我正在制作响应式作品集,但我的灯箱缩略图处于停滞状态。当浏览器宽度减小时,我需要缩略图与网站的其余部分一起缩小,但目前它只是保持相同的大小。我不确定从这里去哪里。任何帮助将不胜感激!
灯箱 css 文件链接:https://drive.google.com/folderview?id=0BxgeLB33TSvCUWFvSVZWNTVidDQ&usp=sharing
lightbox.js 链接:https://drive.google.com/file/d/0BxgeLB33TSvCZUpYZG1TY3VXUjA/edit?usp=sharing
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Portofolio</title>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/lightbox.min.js"></script>
</script>
<link href="css/lightbox.css" rel="stylesheet" />
<link href="style.css" type="text/css" rel="stylesheet" />
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">
<h1><a href="">NAME</a></h1>
</div>
<div id="nav">
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</div>
</div>
<div id="content">
<div class="article column1">
<a href="images/article.jpg" data-lightbox="image-1" data-title="Article"> <img class="hoverme" src="images/2.jpg"></a>
</div>
<div class="article column2">
<p>Column Two</p>
</div>
<div class="article column3">
<p>Column Three</p>
</div>
<div class="article column1">
<p>Column One</p>
</div>
<div class="article column2">
<p>Column Two</p>
</div>
<div class="article column3">
<p>Column Three</p>
</div>
</div>
<div id="footer">
<p>Footer Text</p>
</div>
</div>
</script>
</body>
</html>
CSS:
@font-face {
font-family: 'bikoblack';
src: url('fonts/biko_black.otf');
}
@font-face {
font-family: 'bikoregular';
src: url('fonts/biko_regular.otf');
}
a:link {
color: #0f4c96;
}
a:visited {
color: #0f4c96;
}
a:hover {
color: #b2b1b1;
}
a:active {
color: #0f4c96;
}
* {
text-align: center;
}
body {
margin: 0;
font-size: 100%;
background-color: white;
}
#wrapper {
max-width:90%;
margin:0 auto;
}
h1 {
font-family: 'bikoblack';
text-transform: uppercase;
font-size: 3.5em;
line-height: 85%;
color: #0f4c96;
float: left;
}
#header {
position:relative;
overflow:hidden;
}
#nav {
position:absolute;
bottom:1.25em;
right:1em;
}
li {
display: inline;
font-family: 'bikoregular';
color: #0f4c96;
padding-left: 2em;
}
#feature{
background-color: #b2b1b1;
padding: 5em;
}
.column1, .column2, .column3 {
width: 32.66%;
float: left;
margin: 1% 1% 1% 0;
background-color: #b2b1b1;
}
.column3 {
margin-right: 0%;}
}
#feature, .article {
margin-bottom: 1em;
}
@media (max-width:767px) {
h1 {
float: none;
width:100%;
text-align:center;
}
#nav {
position:static;
width:100%;margin:0 auto;
top: 5em;
}
li {
width:100px;
padding: 0 1em;
}
}
@media (max-width:480px){
li {
display:block;
text-align:center;
width:auto;
}
}
a {text-decoration: none; }
【问题讨论】:
-
您能否创建一个 jsfiddle 或提供更容易复制和粘贴的代码,以便在测试服务器中设置。即:lightbox.css 没有作为存储库链接给出或提供;您假设 style.css 是提供的 CSS 代码示例。如果你更简洁,你会得到更好的答案。
-
对不起,我没想到。这是灯箱 css 文件:drive.google.com/…
-
刚刚在小提琴中添加了lightbox.css,仍然有效。现在只有js不见了。
-
np ;)。从那里包含 js 不起作用,猜猜如果您只是检查为 img 宽度和/或高度添加 css 是否适合您,会更容易。将检查是否在线找到此 lightbox.js 以包含它或向下 + 上传它。
标签: javascript jquery html css