Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="hoverText">
- <span class="onHoverText"> Hello </span>
- </div>
- .hoverText
- {
- display: none;
- position: absolute;
- text-align: center;
- font-size: 20px;
- top: 0%;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.5);
- }
- .onHoverText
- {
- position: absolute;
- top:50%;
- }
- $(".img-wrapper").mouseenter(function()
- {
- $(this).parent().find(".hoverText").show();
- }).mouseleave(function()
- {
- $(this).parent().find(".hoverText").hide();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement