1. <i id='jphGK'><tr id='jphGK'><dt id='jphGK'><q id='jphGK'><span id='jphGK'><b id='jphGK'><form id='jphGK'><ins id='jphGK'></ins><ul id='jphGK'></ul><sub id='jphGK'></sub></form><legend id='jphGK'></legend><bdo id='jphGK'><pre id='jphGK'><center id='jphGK'></center></pre></bdo></b><th id='jphGK'></th></span></q></dt></tr></i><div id='jphGK'><tfoot id='jphGK'></tfoot><dl id='jphGK'><fieldset id='jphGK'></fieldset></dl></div>

    <tfoot id='jphGK'></tfoot>
    <legend id='jphGK'><style id='jphGK'><dir id='jphGK'><q id='jphGK'></q></dir></style></legend>

      <bdo id='jphGK'></bdo><ul id='jphGK'></ul>
  2. <small id='jphGK'></small><noframes id='jphGK'>

      如何为缩略图悬停添加标题 - Bootstrap?

      时间:2023-11-29
        <tbody id='3y9Xa'></tbody>
          1. <small id='3y9Xa'></small><noframes id='3y9Xa'>

              <bdo id='3y9Xa'></bdo><ul id='3y9Xa'></ul>
              <i id='3y9Xa'><tr id='3y9Xa'><dt id='3y9Xa'><q id='3y9Xa'><span id='3y9Xa'><b id='3y9Xa'><form id='3y9Xa'><ins id='3y9Xa'></ins><ul id='3y9Xa'></ul><sub id='3y9Xa'></sub></form><legend id='3y9Xa'></legend><bdo id='3y9Xa'><pre id='3y9Xa'><center id='3y9Xa'></center></pre></bdo></b><th id='3y9Xa'></th></span></q></dt></tr></i><div id='3y9Xa'><tfoot id='3y9Xa'></tfoot><dl id='3y9Xa'><fieldset id='3y9Xa'></fieldset></dl></div>

              1. <legend id='3y9Xa'><style id='3y9Xa'><dir id='3y9Xa'><q id='3y9Xa'></q></dir></style></legend>
                <tfoot id='3y9Xa'></tfoot>
                本文介绍了如何为缩略图悬停添加标题 - Bootstrap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试将此缩略图悬停字幕插件用于引导程序.

                解决方案

                您需要在图像上方放置另一个 div 并根据您的需要设置样式.

                然后根据 Bootstraps 滑动等添加 hide() 或 show()

                FIDDLE

                HTML:

                <li class="span3"><div 类="缩略图"><div 类="标题"><h4>字幕标题</h4><p>Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt.</p><p><a href="#" class="btn btn-inverse" rel="tooltip" title="Preview"><i class="icon-eye-open"></i></a><a href="#" rel="tooltip" title="访问网站" class="btn btn-inverse"><i class="icon-share"></i></a></p></div><div class="caption-btm">Lorem ipsum dolor sit amet, consectetur adipisicing eli...</div><img src="http://placehold.it/600x400" alt="ALT NAME"></div><h4>项目名称</h4></li>

                CSS:

                .caption-btm{背景:rgba(0,0,0,0.6);宽度:100%;高度:30px;位置:绝对;底部:4px;颜色:#fff;}

                JQuery:

                $('#hover-cap-4col .thumbnail').hover(功能() {$(this).find('.caption').slideDown(250);$('.caption-btm').hide(100);},功能() {$(this).find('.caption').slideUp(250);$('.caption-btm').show(450);});

                编辑

                上面的 Jquery 将显示和隐藏每个 .caption-btm.

                但这会隐藏它被悬停的特定的:

                FIDDLE

                jquery:

                 $('#hover-img .thumbnail').hover(功能 () {$(this).find('.caption').slideDown(250);$(this).find('.caption-btm').hide(250);},功能 () {$(this).find('.caption').slideUp(250);$(this).find('.caption-btm').show(250);});

                I am trying to use this thumbnail hover caption plugin for bootstrap.

                http://sevenx.de/demo/bootstrap/thumbnail-hover-caption.html

                This is the code.

                <div class="thumbnail">
                                <div class="caption" style="display: none;">
                                    <h4>Caption Title</h4>
                                    <p><a href="#" class="btn btn-inverse" rel="tooltip" title="" data-original-title="Preview"><i class="icon-eye-open"></i></a> <a href="#" rel="tooltip" title="" class="btn btn-inverse" data-original-title="Visit Website"><i class="icon-share"></i></a></p>
                                </div>
                                <img src="http://placehold.it/600x400" alt="ALT NAME">
                              </div>
                

                In this page, there is a part 'SlideIn/Out'.

                When you hover on a thumbnail normally it slides in or out. This is what I want.

                However, what I also need is when my cursor is not hover on thumbnail, there should be small caption at the bottom which I will write there a tagline.

                So basically, default position will be small caption, when my mouse is over thumbnail it will slide in.

                This is an exact example what I need. It can be viewed http://www.usatoday.com/news/

                NO HOVER

                HOVER

                This is the jsfiddle page http://jsfiddle.net/g4j8B/

                解决方案

                You need to place another div above the image and style it to your needs.

                Then add the hide() or show() according to the Bootstraps sliding etc.

                FIDDLE

                HTML:

                <li class="span3">
                                    <div class="thumbnail">
                                        <div class="caption">
                                             <h4>Caption Title</h4>
                
                                            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</p>
                                            <p><a href="#" class="btn btn-inverse" rel="tooltip" title="Preview"><i class="icon-eye-open"></i></a>  <a href="#" rel="tooltip" title="Visit Website" class="btn btn-inverse"><i class="icon-share"></i></a>
                
                                            </p>
                                        </div>
                                        <div class="caption-btm">Lorem ipsum dolor sit amet, consectetur adipisicing eli...</div>
                                        <img src="http://placehold.it/600x400" alt="ALT NAME">
                                    </div>
                                     <h4>Item Name</h4>
                
                                </li>
                

                CSS:

                .caption-btm{
                        background: rgba(0,0,0,0.6);
                        width: 100%;
                        height: 30px;
                        position: absolute;
                        bottom: 4px;
                        color: #fff;
                    }
                

                JQuery:

                $('#hover-cap-4col .thumbnail').hover(
                
                                function() {
                                    $(this).find('.caption').slideDown(250);
                                    $('.caption-btm').hide(100);
                                },
                
                                function() {
                                    $(this).find('.caption').slideUp(250);
                                    $('.caption-btm').show(450);
                                });
                

                EDIT

                The above Jquery will show and hide every .caption-btm.

                But this will hide the specific one that it's being hovered over:

                FIDDLE

                Jquery:

                    $('#hover-img .thumbnail').hover(
                
                            function () {
                                $(this).find('.caption').slideDown(250);
                                $(this).find('.caption-btm').hide(250);
                            },
                
                            function () {
                                $(this).find('.caption').slideUp(250);
                                $(this).find('.caption-btm').show(250);
                            });
                

                这篇关于如何为缩略图悬停添加标题 - Bootstrap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:有没有办法提高 MSAL 浏览器 js 登录的性能? 下一篇:CSS悬停在div上,但如果悬停在他的孩子身上则不会

                相关文章

                  <i id='rVhec'><tr id='rVhec'><dt id='rVhec'><q id='rVhec'><span id='rVhec'><b id='rVhec'><form id='rVhec'><ins id='rVhec'></ins><ul id='rVhec'></ul><sub id='rVhec'></sub></form><legend id='rVhec'></legend><bdo id='rVhec'><pre id='rVhec'><center id='rVhec'></center></pre></bdo></b><th id='rVhec'></th></span></q></dt></tr></i><div id='rVhec'><tfoot id='rVhec'></tfoot><dl id='rVhec'><fieldset id='rVhec'></fieldset></dl></div>

                    <bdo id='rVhec'></bdo><ul id='rVhec'></ul>
                1. <tfoot id='rVhec'></tfoot>

                  <small id='rVhec'></small><noframes id='rVhec'>

                    <legend id='rVhec'><style id='rVhec'><dir id='rVhec'><q id='rVhec'></q></dir></style></legend>