How can I move the close button to the top-right corner of the box in slimbox (jQuery)

Posted by janoChen on Stack Overflow See other posts from Stack Overflow or by janoChen
Published on 2010-04-03T09:41:02Z Indexed on 2010/04/03 9:43 UTC
Read the original article Hit count: 503

Filed under:
|

I want to have my button in the top-right corner, I tried position: absolute, but I think the position of the box is not relative so I can't use top: 0;.

Any suggestions?

CSS:

/* SLIMBOX */

#lbOverlay {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    cursor: pointer;
}

#lbCenter, #lbBottomContainer {
    position: absolute;
    z-index: 9999;
    overflow: hidden;
    background-color: #fff;
}

.lbLoading {
    background: #fff url(slimbox2/loading.gif) no-repeat center;
}

#lbImage {
    position: absolute;
    left: 0;
    top: 0;
    border: 10px solid #fff;
    background-repeat: no-repeat;
}

#lbPrevLink, #lbNextLink {
    display: block;
    position: absolute;
    top: 0;
    width: 50%;
    outline: none;
}

#lbPrevLink {
    left: 0;
}

#lbPrevLink:hover {
    background: transparent url(slimbox2/prevlabel.gif) no-repeat 0 15%;
}

#lbNextLink {
    right: 0;
}

#lbNextLink:hover {
    background: transparent url(slimbox2/nextlabel.gif) no-repeat 100% 15%;
}

#lbBottom {
    font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
    font-size: 10px;
    color: #666;
    line-height: 1.4em;
    text-align: left;
    border: 10px solid #fff;
    border-top-style: none;
}

#lbCloseLink {
    display: block;
    float: right;
    width: 31px;
    height: 32px;
    background: transparent url(slimbox2/closelabel.gif) no-repeat center;
    margin: 5px 0;
    outline: none;
}
#lbCloseLink:hover {
    background: transparent url(slimbox2/closelabel_hover.gif) no-repeat center;
    border-bottom: 0px;
}

#lbCaption, #lbNumber {
    margin-right: 71px;
}

#lbCaption {
    font-weight: bold;
}

© Stack Overflow or respective owner

Related posts about plugin

Related posts about jQuery