我試圖做一個透明的覆蓋圖,點擊圖片時會出現一些文字。我已經得到它來做動畫,但我需要它從自下而上,而不是自上而下。反向jQuery高度動畫
HTML
=======
<!-- Element -->
<div class="char">
<div class="content">
<p id="nesstxt">ness is the bess</p>
<img id="ness" src="http://images3.wikia.nocookie.net/__cb20120802002608/ssb/images/2/25/Ness(Clear).png" />
<div id="nessoverlay"></div>
</div>
<div class="content">
<p id="pootxt">poo is my doo</p>
<img id="poo" width="215px" height="369px" src="http://images4.wikia.nocookie.net/__cb20081118173625/earthbound/images/4/4b/Poo_Clay.png" />
<div id="poooverlay"></div>
</div>
</div>
CSS
=======
div.char{
max-width:50%;
margin: 0 auto;
padding:0;
}
/*styling for effective overlay*/
#nessoverlay, #poooverlay"{
height: 100%;
background-color: black;
opacity: 0.7;
filter: alpha(opacity = 70);
position: absolute;
bottom: 0; left: 0; right: 0;
display: none;
z-index: 2;
}
/*box that holds it together*/
.content{
width:215px;
height:369px;
position:relative;
z-index:1;
display:inline;
padding:25px;
}
/*center txt and animate*/
#nesstxt, #pootxt{
position: absolute;
right: 0;
bottom: 0;
width: 70%;
color: white;
display: none;
z-index: 3;
}
jQuery
=======
$(document).ready(function(){
$('#nessoverlay, #nesstxt, #ness').click(function(){
$('#nessoverlay, #nesstxt').slideToggle();
});
});
$(document).ready(function(){
$('#poo, #poooverlay, #pootxt').click(function(){
$('#poooverlay, #pootxt').slideToggle();
});
});
另外,我需要關於與覆蓋內嵌的圖片,這是我無法弄清楚如何使它工作的4。任何幫助將非常感激。
你應該考慮問一個不同的問題,而不是編輯它改變整個問題。 – sergioadh