English 中文(简体)
在线清单内容,增加超支数目
原标题:Inline list elements, add numbering overlay

我用jquery灯光箱提炼了几年前的lu。

<div class="p">
    <ul class="gallery">
        <li><a rel="lightbox-gallery" href="..."><img src="..."></a></li>
        <li>...</li>
    </ul>
</div>

div.p {
    text-align: justify;
}

.gallery li {
    display: inline;
    list-style-type: none;
}

或许这并不完美,但它甚至在整个一栏中都有空间,并且自行调整窗口。

现在,有近40个剂量,我想增加 > 。 a 略微超支,有照相号码,例如:

“example”/

但是,我感到有些麻烦,因为一些因素行不通,而不是阻碍。

能否做到这一点?

最佳回答
问题回答

In this demo, I added this bit of code:

$(function(){
    $( .gallery ).find( a ).each(function(i){
        $(this).append( <div class="number">  + (i+1) +  </div> )
    });
});

and this css

.gallery .number {
    background: #eee;
    color: #000;
    min-width: 20px;
    height: 20px;
    position: absolute;
    font-size: 20px;
    line-height: 15px;
    bottom: 15px;
    right: 3px;
    z-index: 1;
    text-align: center;
    padding-top: 2px;
}
.gallery a {
    position: relative;
}

Edit: Oops, you can just add the i+1 to the demo...





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!