]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Change 'document' to 'window' in code example 4792/head
authoriamalexkempton <iamalexkempton@googlemail.com>
Tue, 25 Mar 2014 16:32:33 +0000 (16:32 +0000)
committeriamalexkempton <iamalexkempton@googlemail.com>
Tue, 25 Mar 2014 16:32:33 +0000 (16:32 +0000)
The current code example of binding a resize event to 'document' does not actually work. Binding the  event to 'window' does. :)

doc/pages/javascript-utilities.html

index bd18d71a2f8059435856d7c4d6fc263ab2be8d2d..211d8ad0082e0532b6a0dba4702f9145b9b4b80e 100644 (file)
@@ -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));
 ```