0

I am upgrading from jQuery 1.7 to jQuery 3.0

I am stuck updating the menu_hover.js file as jQuery 3 no longer supports browser.msie. It was dropped as of jQuery 1.9, and is no longer supported.

Can somebody please help me replace / redefine the following line?

if ($.browser.msie && $.browser.version.substr(0,1)<7)

here is the original menu_hover.js file:

$(function() {
   if ($.browser.msie && $.browser.version.substr(0,1)<7)
   { 
     $('li').has('ul').mouseover(function(){
        $(this).children('ul').show();
     }).mouseout(function(){
        $(this).children('ul').hide();
     })
   }
});
Paul Roub
  • 36,322
  • 27
  • 84
  • 93

1 Answers1

0

I would advise using jQuery Migrate. This lets you migrate older jQuery code to jQuery 3.0+. You can add it to your script by using:

<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.0.0.js"></script>
Griffin M.
  • 196
  • 1
  • 17