I created a JSFiddle which works as intended.
//Jquery script
function icon_hover()
{
$("#gcp-icon").hover( function(){
$("#gcp-icon-hover").slideDown();
},
function(){
$("#gcp-icon-hover").slideUp();
});
}
icon_hover();
//CSS
.site_logo{
width: 250px;
height: 250px;
background-color: rgba(0, 0, 0, 0.75);
}
.site_logo_hover{
width: 250px;
height: 250px;
background-color:#000000;
opacity:0.6;
display:none;
}
#gcp-icon
{
background: url(http://i.imgur.com/soDjoS4.png) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.hover_title{
color: white;
width: 220px;
margin-left: auto;
margin-right: auto;
padding-top: 80px;
font-weight: 600;
font-size: 11pt;
font-family: verdana;
}
.hover_text{
color: white;
width: 245px;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
font-family: verdana;
font-size:9pt;
}
.click_me{
color: white;
width: 160px;
margin-left: auto;
margin-right: auto;
margin-top: 8px;
font-weight: 600;
font-size: 10pt;
font-family: verdana;
}
<!--HTML-->
<div class="site_logo" id="gcp-icon">
<div class="site_logo_hover" id="gcp-icon-hover">
<div class="hover_title" id="gcp-title">Grace Cook Photography</div>
<div class="hover_text" id="gcp-text">Simple, subtle, clean and good looking</div>
<div class="click_me">Click for more details</div>
</div>
</div>
However, as the title suggests, when this is copied and pasted into a html page and opened in a web browser see this, this doesn't work as intended.
I have tried debugging. The Javascript is valid and all dependencies(eg. Jquey.js etc.) are available.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…