Languages
[Edit]
EN

jQuery - mouse hover event example

11 points
Created by:
AnnLen
9180

Using jQuery it is possible to create mouse hover event in following way.

1. hover method example

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
</head>
<body>
  <div id="element" style="padding: 10px; background: orange;">
    Move mouse over element...
  </div>
  <script>

    $(document).ready(function() {
		var element = $('#element');

        function onMouseOver() {
            element.text('Mose over element...');
        }

        function onMouseLeft() {
            element.text('Mose left element...');
        }
      
      	element.hover(onMouseOver, onMouseLeft);
    });

  </script>
</body>
</html>

 

Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join