Introduction
In this article I will explain how to use jQuery to show a span on Hover in PHP. I will use a simple example of showing a span on hover using HTML, jQuery and CSS. You can include our PHP project for showing a span.
Example
This is your CSS script. Include this code in the head section.
ul
{
margin:0px;
padding:0px;
}
#pictures li
{
list-style:inline;
margin:0px;
padding:0px;
}
#pictures span
{
display:none;
}
#pictures hover
{
visibility:none;
}
The following is your jQuery code for showing a span on a Hover using jQuery functions:
$(function () {
$(".imageanimation").hover(function () {
$(this).closest("li").next("span").show(500);
},
function () {
$(this).closest("li").next("span").hide(400);
});
});
This is your final code. You can try this example for showing a span on the Hover event:
<html>
<head>
<style>
ul
{
margin:0px;
padding:0px;
}
#pictures li
{
list-style:inline;
margin:0px;
padding:0px;



Join the conversation! Your thoughts help the community grow.