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
| <!DOCTYPE html> | |
| <html> | |
| <head></head> | |
| <body> | |
| <select name="test_name" id="test_options"> | |
| <option>test 1</option> | |
| <option>test 2</option> | |
| <option>test 3</option> | |
| </select> |
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
Show hidden characters
| { | |
| "browser" : false, | |
| "curly" : true, | |
| "eqeqeq" : true, | |
| "eqnull" : true, | |
| "indent" : 4, | |
| "latedef" : true, | |
| "noarg" : true, | |
| "strict" : false, | |
| "trailing" : true, |
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 () { | |
| function parallax(elm, move) { | |
| window.addEventListener('scroll', function(){ | |
| var win_offset = window.pageYOffset; | |
| var bg_scroll = document.querySelectorAll(elm); | |
| var bg_scroll_len = bg_scroll.length; | |
| var parallax = win_offset / parseFloat('1.' + move); | |
| for (var i = bg_scroll_len - 1; i >= 0; i--) { | |
| bg_scroll[i].style.backgroundPosition = '0 -' + parallax + 'px'; |
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 float-rgba($r, $g, $b, $a-float) { | |
| $alpha: $a-float / 255; | |
| @return rgba($r, $g, $b, $alpha) | |
| } | |
| //EXAMPLE | |
| .someclass { | |
| color: float-rgba(255, 255, 255, 100); | |
| } |
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
| $.fn.parallax = function() { | |
| var $parallax = this; | |
| $(window).on('scroll', function () { | |
| var win_offset = window.pageYOffset; | |
| $parallax.each(function (i){ | |
| var $local_this = $(this); | |
| var type = $local_this.attr('data-type'); | |
| var speed = $local_this.attr('data-parallax'); | |
| var direction = $local_this.attr('data-direction') || 'up'; | |
| var parallax = win_offset / +speed; |
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(){ | |
| var CSSrefresher, hash, interval; | |
| var styles = document.querySelectorAll('link[rel="stylesheet"]'); | |
| var ev = { | |
| start: function () { | |
| console.log('start refreshing every ' + interval/1000 + ' seconds'); | |
| clearInterval(CSSrefresher); | |
| CSSrefresher = setInterval(ev.refresh, interval); | |
| }, | |
| refresh: function () { |
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
| // base 2 to base 16 | |
| var i = 255; | |
| i.toString(16); | |
| //output "ff" | |
| // base 16 to base 2 | |
| var f = 'ff'; | |
| parseInt(f, 16); | |
| // output 255 |
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 () { | |
| // I know chrome does this but I would like it to stay around. | |
| // update, chrome does not do this any more. | |
| var scaler, | |
| scaleWrapper = ['<div id="scaleShow"', | |
| 'style="position:fixed;background:#fff;top:0;left:0;padding:5px;opacity:0.6;">', | |
| window.innerWidth + 'px x ' + window.innerHeight + 'px - ' + window.devicePixelRatio, | |
| '</div>'].join(' '); | |
| document.body.insertAdjacentHTML('beforeend', scaleWrapper); |
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
| /** | |
| * --- Index --- | |
| * 1. vertical-align | |
| * 2. transform-origin | |
| * 3. transform | |
| * 4. filter | |
| */ | |
| @mixin vendor-prefix($name, $value) { | |
| @each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') { |