![]() |
jQuery hover()
hover is a jQuery function that can trigger two functions when the mouse enters and leaves an element on the current page.Example of what you get using jquery hover()
In this example, when the mouse enters each line of the table, a CSS class is added. Then when the mouse leaves the current line, the previous CSS class is removed.button is clicked, the first, third, and fifth block will be selected and get their containers filled with a background color.Line 1 |
Line 2 |
Line 3 |
Line 4 |
Line 5 |
Step 1
You need to add the elements that will get the effects triggered by the hover() function. In our example, each line of the table will get a temporary CSS background when the mouse rollover them
12345678910111213 <style type="text/css"> .hover{ background-color:#DDD; } </style> <table> <tr><td>Line 1</td></tr> <tr><td>Line 2</td></tr> <tr><td>Line 3</td></tr> <tr><td>Line 4</td></tr> <tr><td>Line 5</td></tr> </table>
Step 2
12345678910111213 <script type="text/javascript"> $('td').hover( function(){ $(this).addClass('hover'); }, function(){ $(this).removeClass('hover'); } ); </script
Do you know:-
- How to Retrieve data using dataset in c#
- “Login failed for user” SQLConnection using C#
- How can I prevent the browser back button After Logout
- Calendar Control in c# Windows Application
- Timer tick event in c# windows application
- How to delete record in c# using the connected approach
- [Connect] to Database c# Through Code
- The Command Class | C# | TrickCode
- C# DataReader ADO.NET |Trickcode
- What is disconnected data access?
- how to Adding Parameters to Commands
- SQL Basics?
- What is Database Preparations?
- SQL vs NoSQL or MySQL vs MongoDB
- What is data provider in C#?
- What is connection string C#?
- [SQL] SELECT Statement | Example
- how to get return value from stored procedure in sql server
- how to prevent sql injection attacks
- What is Database? What is SQL?
- C#.Net How To: Send email in asp.net using c#
If you like the tutorial, then please share this tutorial with your friends on social media.
Post A Comment:
0 comments: