
Determine screen width with jquery
Found a script to determine the screen width via jquery in that cases, if you don't have the option to use css3. Think, will be useful for adaptive layout of the site. Events fire when, when your screen width gets smaller than a given point.
The script is called BREAKPOINTS.JS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | $(window).setBreakpoints({ // use only largest available vs use all available distinct: true, // array of widths in pixels where breakpoints // should be triggered breakpoints: [ 320, 480, 768, 1024 ] }); $(window).bind('enterBreakpoint320',function() { ... }); $(window).bind('exitBreakpoint320',function() { ... }); $(window).bind('enterBreakpoint768',function() { ... }); $(window).bind('exitBreakpoint768',function() { ... }); $(window).bind('enterBreakpoint1024',function() { ... }); $(window).bind('exitBreakpoint1024',function() { ... }); |
To see an example of how the script works, go to link.
The script can be downloaded from github.

/*

- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.