在图像下制作图片标题?

时间:2014-10-20 14:29:28

标签: javascript css image drop-down-menu

我遇到一些麻烦,要让我的图片标题在图像下滑动而不是现在的图像。 所以它不会向下滑动。

我尝试了一切,但找不到合适的代码进行更改,因为我不是真正的编码器,所以不知道这是.css还是.js问题。我在玩我的css但没有成功。

您可以在此处查看:HERE

我喜欢在图片下滑动的标题,但对下面的图片没有影响,它必须在所有前面。 这是我的css:

.team-member{
    position:relative;
display: inline-block;
    overflow:hidden;
    padding-bottom:89px;
    margin-bottom:30px;
margin-right: 10px;
    width: 269px;
    border-radius:3px;
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
}

.team-member .team-member-image{
    width:100%;
}

.team-member-info{
    padding:10px;
    position:absolute;
    z-index:10;
    margin-top:-89px;
    top:100%;
    left:0;
    background:#fff;
    right:0;
    bottom:0;


    transition: all 0.4s;
    -webkit-transition: all 0.4s;
    -moz-transition: all 0.4s;
    backface-visibility: hidden;
}

.team-member .social-media li{
    margin-right:4px;
}

.team-member .social-media li:last-child{
    margin-right:0;
}

.team-member-more{
    transform: scale(0);
    -webkit-transform: scale(0);
    -moz-transform: scale(0);
    -o-transform: scale(0);
    transition: all .4s ease 0.1s;
    -webkit-transition: all .4s ease 0.1s;
    -moz-transition: all .4s ease 0.1s;
}   

.team-member:hover .team-member-info{
    top:80px;
}

.team-member:hover .team-member-more{
    opacity:1;
    -moz-opacity:1;
    transform: scale(1);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -o-transform: scale(1);
}

.team-member-info h2{
    margin:3px 0 0;
}

.team-member-info .job{
    color:#95999e;
    font-size:13px;
    display:block;
    margin-bottom:17px;
    white-space:nowrap;
}

.team-member.big{
    background:#fff;
    padding:0;
}

.team-member.big .team-member-image{
    width:50%;
    padding-right:15px;
    float:left;
}

.team-member.big .team-member-info{
    position:relative;
    margin-top:0;
    top:0;
    float:left;
    width:50%;
    padding:30px 30px 30px 15px;
}

.team-member.big .team-member-more{
    opacity:1;
    -moz-opacity:1;
    transform: scale(1);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -o-transform: scale(1);
}

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

根据您的要求,我已将代码简化为裸骨水平。此代码段中没有CSS转换,但我确信您可以修改/添加到代码段中。我刚刚添加了一个容纳所有这些团队成员的容器。我已经给出了一些不同的颜色来区分不同的div ...所以这里就是..

#container{
            margin:0 auto;
            width:900px;
            height: 700px;
            background-color: rgba(225,225,225,0.5);
        }
        .team-member{
            float:left;
            box-sizing:border-box;
            width: 269px;
            margin:10px;
            height:280px;
            overflow: hidden;
        }
        .team-member-image{
            display: inline-block;
        }
        .team-member-info{
            background-color: #f0ffa1;
            padding:10px;
        }
        .team-member-more{
            height: 279px;
            display:none;
            padding:10px;
            position: relative;
        }
        .team-member:hover .team-member-more{
            display: block;
            z-index: 100;
            background-color: #ffd52f;
        }
        .team-member:hover{
            overflow: visible;
        }
<div id="container">
    
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>John Rambo</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                     <p>John James Rambo. He was born on July 6, 1946 in Bowie, Arizona, to a Navajo father (whose name according to the last film was probably R. Rambo) and an Italian American mother Marie Drago.</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
        
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>nisi probant</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                <p>Amet appellat voluptate, tamen te nescius ubi multos ab malis quamquam adipisicing ita incurreret iis probant. Ex ut noster nisi quae ut vidisse aute arbitror laborum, incurreret tamen deserunt o fugiat senserit o expetendis.</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
        
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>familiaritatem eram</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                <p>quorum nostrud excepteur qui irure cillum senserit appellat fugiat varias expetendis excepteur eruditionem voluptatibus possumus</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
    
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>John Rambo</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                     <p>John James Rambo. He was born on July 6, 1946 in Bowie, Arizona, to a Navajo father (whose name according to the last film was probably R. Rambo) and an Italian American mother Marie Drago.</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
    
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>John Rambo</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                     <p>John James Rambo. He was born on July 6, 1946 in Bowie, Arizona, to a Navajo father (whose name according to the last film was probably R. Rambo) and an Italian American mother Marie Drago.</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
    
        <div class="team-member animate-onscroll ">
            <img class="team-member-image" src="http://img4.wikia.nocookie.net/__cb20120110224126/rambo/images/c/c1/John_James_Rambo.jpg" width="100%" alt="" />
            <div class="team-member-info">
                <h2>John Rambo</h2>
                <span class="job">The Warior</span>        
            </div>

            <div class="team-member-more">
                     <p>John James Rambo. He was born on July 6, 1946 in Bowie, Arizona, to a Navajo father (whose name according to the last film was probably R. Rambo) and an Italian American mother Marie Drago.</p>
                     <ul class="list arrow-list">
                         <li>Bow</li>
                         <li>Guns</li>
                         <li>Other Stuff</li>
                     </ul>
             </div>
        </div>
	
    </div>

您可以在此代码段周围添加任何样式...希望这会有所帮助。如果您认为我提供了一个不错的答案,并且您满意,请不要忘记将其标记为已接受的答案。感谢

相关问题