html - 通过单击背景 <image> 打开模式

标签 html css twitter-bootstrap button modal-dialog

我有一个打开模式的按钮,按钮在背景图片上,我必须让照片充当按钮。

我有这个 HTML:

<div id="cih1" class="cuadro_intro_hover">
        <img class="lazy" data-original="img/products/001.jpg" alt="">
    <div id="cihc1" class="caption">
        <div id="cihb1" class="blur">
        </div>
        <div class="caption-text">
            <img class="" src="img/maieu.png" alt="" style="width: 114px; height: 140;">
            <h3>Golden Fish</h3>
            <p>Price: 100Lei</p>
            <a href="#Modal1" class="btn btn-primary portfolio-link" data-toggle="modal"><span>Info</span></a>
        </div>

    </div>
</div>

...这是打开模式的按钮:

<a href="#Modal1" class="btn btn-primary portfolio-link" data-toggle="modal"><span>Info</span></a>

我必须表现得像但没有手形鼠标光标。

谢谢。

最佳答案

如果我正确理解了你的问题,这应该可以解决问题:

$('img').on(
    'click',
    function () {
        $('.portfolio-link').click();
    }
)

您可能应该向 img 标签添加一些特殊的类或 ID。

关于html - 通过单击背景 <image> 打开模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27591947/

相关文章:

php - 如何在PHP中检测手机和平板电脑

javascript - 搜索栏未在导航栏中对齐

html - 无法让 CSS 轮播幻灯片 img 或其中的文本成为可点击的链接

html - 社交图标的 DIV 未出现在 Wordpress Mobile 上

html - 嵌套表格中下拉菜单的 CSS 问题

html - 为什么我的 bootstrap 标签和徽章在我的三星 s3 上消失了

javascript - span 标签的内容被 chop

jquery - 检查 Bootstrap 折叠导航栏是否溢出

html - Bootstrap Jumbotron 与 Container-fluid

twitter-bootstrap - 如何在 html 选择中使用 Bootstrap 3 字形图标