- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Skeleton CSS Boilerplate 构建我的网站,并且在网格内我想使用免费的灯箱“HTML5 LightBox”。但是,当我单击任何灯箱时,它似乎被我的第一个灯箱/div 否决了。
这让我很困惑,因为我或多或少是 HTML 的初学者,所以我不知道代码中的错误可能出在哪里。
图像显示正确,p class="imgtext"也显示正确,但是,当我单击第二个图像时,我会看到网站 1 的灯箱。
这是前两列的片段,其中包含相应的灯箱:
<div class="container main">
<div class="row">
<div class="four columns portfolio">
<div id="mydiv" style="display:none;">
<div class="lightboxcontainer">
<div class="lightboxleft">
<div class="divtext">
<p class="divtitle" style="font-size:16px;font-weight:bold;margin:12px 0px;">Website 1</p>
<p class="divdescription" style="font-size:14px;line-height:20px;">xxxWonderPlugin Gallery is a WordPress photo and video gallery plugin, and a great way to showcase your images and videos online. The plugin supports images, YouTube, Vimeo, Dailymotion, mp4 and webm videos. It's fully responsive, works on iPhone, iPad, Android, Firefox, Chrome, Safari, Opera and Internet Explorer 7/8/9/10/11.</p>
</div>
</div>
<div class="lightboxright">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/wswxQ3mhwqQ" frameborder="0" allowfullscreen></iframe>
</div>
<div style="clear:both;"></div>
</div>
</div>
<a href="#mydiv" class="html5lightbox" data-width="800" data-height="400" >
<div href="#mydiv" class="html5lightbox" data-width="800" data-height="400" id="imagelist">
<a href="#">
<img class="grid" src="images/rven.jpg" />
<p class="imgtext">
<span>
<span>Website 1</span>
</span>
</p>
</a>
</div>
</a>
</div><!-- End of element-->
<div class="four columns portfolio">
<div id="mydiv" style="display:none;">
<div class="lightboxcontainer">
<div class="lightboxleft">
<div class="divtext">
<p class="divtitle" style="font-size:16px;font-weight:bold;margin:12px 0px;">Website 2</p>
<p class="divdescription" style="font-size:14px;line-height:20px;">WonderPlugin Gallery is a WordPress photo and video gallery plugin, and a great way to showcase your images and videos online. The plugin supports images, YouTube, Vimeo, Dailymotion, mp4 and webm videos. It's fully responsive, works on iPhone, iPad, Android, Firefox, Chrome, Safari, Opera and Internet Explorer 7/8/9/10/11.</p>
</div>
</div>
<div class="lightboxright">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/wswxQ3mhwqQ" frameborder="0" allowfullscreen></iframe>
</div>
<div style="clear:both;"></div>
</div>
</div>
<a href="#mydiv" class="html5lightbox" data-width="800" data-height="400" >
<div href="#mydiv" class="html5lightbox" data-width="800" data-height="400" id="imagelist">
<a href="#">
<img src="images/sortelunger.jpg" />
<p class="imgtext">
<span>
<span>Website 2</span>
</span>
</p>
</a>
</div>
</a>
</div><!-- End of element-->
</div>
如果有人有任何想法,或者可以为我指出正确的方向,我将非常感激。
亲切的问候。
最佳答案
经过一段时间的摸索,我自己弄清楚了。
问题是我一直在引用 div id“mydiv”。如果我将第一个 div id 设置为“mydiv1”,并将 href 设置为 mydiv1,它会自动选择正确的 div。
这是具有正确 ID 的代码:
<div class="container main">
<div class="row">
<div class="four columns portfolio">
<div id="mydiv1" style="display:none;">
<div class="lightboxcontainer">
<div class="lightboxleft">
<div class="divtext">
<p class="divtitle" style="font-size:16px;font-weight:bold;margin:12px 0px;">Website 1</p>
<p class="divdescription" style="font-size:14px;line-height:20px;">xxxWonderPlugin Gallery is a WordPress photo and video gallery plugin, and a great way to showcase your images and videos online. The plugin supports images, YouTube, Vimeo, Dailymotion, mp4 and webm videos. It's fully responsive, works on iPhone, iPad, Android, Firefox, Chrome, Safari, Opera and Internet Explorer 7/8/9/10/11.</p>
</div>
</div>
<div class="lightboxright">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/wswxQ3mhwqQ" frameborder="0" allowfullscreen></iframe>
</div>
<div style="clear:both;"></div>
</div>
</div>
<a href="#mydiv1" class="html5lightbox" data-width="800" data-height="400" >
<div href="#mydiv1" class="html5lightbox" data-width="800" data-height="400" id="imagelist">
<a href="#">
<img class="grid" src="images/rven.jpg" />
<p class="imgtext">
<span>
<span>Website 1</span>
</span>
</p>
</a>
</div>
</a>
</div><!-- End of element-->
<div class="four columns portfolio">
<div id="mydiv2" style="display:none;">
<div class="lightboxcontainer">
<div class="lightboxleft">
<div class="divtext">
<p class="divtitle" style="font-size:16px;font-weight:bold;margin:12px 0px;">Website 2</p>
<p class="divdescription" style="font-size:14px;line-height:20px;">WonderPlugin Gallery is a WordPress photo and video gallery plugin, and a great way to showcase your images and videos online. The plugin supports images, YouTube, Vimeo, Dailymotion, mp4 and webm videos. It's fully responsive, works on iPhone, iPad, Android, Firefox, Chrome, Safari, Opera and Internet Explorer 7/8/9/10/11.</p>
</div>
</div>
<div class="lightboxright">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/wswxQ3mhwqQ" frameborder="0" allowfullscreen></iframe>
</div>
<div style="clear:both;"></div>
</div>
</div>
<a href="#mydiv2" class="html5lightbox" data-width="800" data-height="400" >
<div href="#mydiv2" class="html5lightbox" data-width="800" data-height="400" id="imagelist">
<a href="#">
<img src="images/sortelunger.jpg" />
<p class="imgtext">
<span>
<span>Website 2</span>
</span>
</p>
</a>
</div>
</a>
</div><!-- End of element-->
关于javascript - <div> 否决其他 <div> 的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34840306/
我正在使用 jquery 使固定位置的导航栏在向下滑动时淡入 .5 不透明度。这行得通,但我也想让栏回到不透明度 1,如果它被鼠标悬停。我尝试了 CSS :hover,但没有用。 HTML: Le
我正在尝试否决 Bootstrap 3 的 css 规则.. 我的自定义 CSS: @media (min-width: 768px) .navbar-nav > li > a { paddi
我有一个 t:datatable 并触发了 rowOnClick 事件。这可行,但我在一列中有一个图标,当您单击该图标时,会打开一个弹出窗口。但它也会触发 rowOnClick 事件。我不希望这样,对
我正在使用 Wordpress 插件“NextGEN Gallery”和“JJ NextGen JQuery Carousel”,因为我正在尝试制作一个看起来很像最后命名插件的默认外观的轮播。问题是插
我的模型包含一个“管理”字段,它是真或假。它不在“attr_accessible”上,因为我们不希望坏人能够欺骗我们的 Controller 向用户提供“管理员”权限。 因为,如果我在我的模型中以管理
我有一个 LI,其中包含一些信息,包括一些链接。我希望 jQuery 使 LI 可点击,但也保留 LI 中的链接。 可点击部分有效。我只需要其中的链接也能正常工作。 注意:如果您右键单击并选择“在新选
如果我将偶数行设为红色,将第二列设为蓝色,则交叉点变为红色。 我正在尝试将整个第二列设为蓝色。 tr:nth-of-type(2n) { background: red; } col:nth-of
我有一个包含周结束日期和流失值的示例数据集,可以是负值也可以是正值。在 ggplot2 中,我使用 scale_fill_manual()在作为组的值的符号上。 这可以很好地显示正值与负值的颜色。此外
我是一名优秀的程序员,十分优秀!