$(function(){}); and $(“document”).ready(function(){}); not acting the same

120 Views Asked by At

If I use:

$(document).ready(function() {
  $("#nav_lat").slicknav({prependTo:"#mobile_menu"});
 });

It doesn’t work on the iphone 6 but it does seem to work everywhere else

However, if I use

jQuery(function($) {
   $("#nav_lat").slicknav({prependTo:"#mobile_menu"});
 });

It seems to work everywhere. Could someone explain what's going on?

0

There are 0 best solutions below