Last active
May 25, 2016 15:18
-
-
Save pixind/50246c5478eae47c0355771f3d2c6ead to your computer and use it in GitHub Desktop.
This file contains 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
calculateSize = (value) -> | |
if value < 768 | |
mode = 'XS - Mobile' | |
if value > 768 and value < 992 | |
mode = 'SM - Tablet' | |
if value > 992 and value < 1200 | |
mode = 'MD - Laptop' | |
if value > 1200 | |
mode = 'LG - Monitor' | |
mode | |
updateInfo = (value) -> | |
$('#tracker-width').text $(this).width() + " Px." | |
$('#tracker-mode').text calculateSize($(this).width()) | |
return | |
$(document).ready -> | |
$(document.body).prepend '<div class="container" style="margin-top:10px; position: fixed; z-index: 10000000;"><div class="row"><div style="width: 200px; padding-left: 10px;"><div class="alert alert-info" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Width: <span id="tracker-width"></span></strong><br /><strong>Mode: <span id="tracker-mode"></span></strong></div></div></div></div>' | |
updateInfo $(this).width() | |
return | |
$(window).resize -> | |
updateInfo $(this).width() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment