Created
March 9, 2013 06:26
-
-
Save roothybrid7/5123108 to your computer and use it in GitHub Desktop.
即時関数のスコープでハマったこと ref: http://qiita.com/items/f66d0e57f1d5f8ed847f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function(global, $, undefined) { | |
| 'use strict'; | |
| // globalはwindowだということを期待している | |
| global.App = global.App || {}; | |
| var App = global.App; | |
| // […] | |
| }(this, jQuery)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| // […] | |
| ;(function(global, $, undefined) { | |
| 'use strict'; | |
| var App = global.App, | |
| document = global.document; | |
| $(document).on('open.menu close.menu', function(e) { | |
| if (e.type == 'open') { | |
| // Menu 表示時 | |
| $('#mainContent').hide(); | |
| $('#menu').fadeIn(); | |
| } else { | |
| $('#menu').fadeOut(function() { | |
| $(global).scrollTop(0); | |
| $('#mainContent').show(); | |
| }); | |
| } | |
| }); | |
| }(window, jQuery)); | |
| // […] | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment