From: iamalexkempton Date: Tue, 25 Mar 2014 16:32:33 +0000 (+0000) Subject: Change 'document' to 'window' in code example X-Git-Tag: v5.2.2~74^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4792%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Change 'document' to 'window' in code example The current code example of binding a resize event to 'document' does not actually work. Binding the event to 'window' does. :) --- diff --git a/doc/pages/javascript-utilities.html b/doc/pages/javascript-utilities.html index bd18d71a2..211d8ad00 100644 --- a/doc/pages/javascript-utilities.html +++ b/doc/pages/javascript-utilities.html @@ -127,7 +127,7 @@ $('.button').on('click', function(e){ }); // Resize function -$(document).on('resize', function(e){ +$(window).on('resize', function(e){ // Do responsive stuff }); ``` @@ -143,7 +143,7 @@ $('.button').on('click', Foundation.utils.debounce(function(e){ }, 300, true)); // Throttled resize function -$(document).on('resize', Foundation.utils.throttle(function(e){ +$(window).on('resize', Foundation.utils.throttle(function(e){ // Do responsive stuff }, 300)); ```