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
| var form = $('#contactForm'); | |
| form.submit(function(event) { | |
| $.ajax({ | |
| type: form.attr('method'), | |
| url: form.attr('action'), | |
| data: form.serialize(), | |
| success: function (data) { | |
| alert('ok'); | |
| } | |
| }); |
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
| $(document).ajaxStart(function() { | |
| $("#loading_indicator").show(); | |
| }).ajaxStop(function(){ | |
| $("#loading_indicator").hide(); | |
| }); |
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 toggle_visibility(id) { | |
| var e = document.getElementById(id); | |
| if(e.style.display == 'block') | |
| e.style.display = 'none'; | |
| else | |
| e.style.display = 'block'; | |
| } | |
| function show(id) { |
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
| var sheet = (function() { | |
| // Create the <style> tag | |
| var style = document.createElement("style"); | |
| // Add a media (and/or media query) here if you'd like! | |
| // style.setAttribute("media", "screen") | |
| // style.setAttribute("media", "@media only screen and (max-width : 1024px)") | |
| // WebKit hack :( | |
| style.appendChild(document.createTextNode("")); |
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
| var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; |
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
| // Retrieve current URL | |
| var url = document.URL; | |
| // Retrieve current root URL | |
| var root = location.protocol + '//' + location.host; |
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
| jQuery.fn.center = function () { | |
| this.css("position","absolute"); | |
| this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); | |
| this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px"); | |
| return this; | |
| } | |
| //Use the above function as: | |
| $(element).center(); |
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
| # Better each() for use with coffeescript | |
| # 1. Wraps child in jquery object | |
| # 2. Sets child first argument, so that fat-binding can be used. | |
| # 3. Sets @ as well, for normal binds | |
| jQuery.fn.loop = (block) -> | |
| for i in @ | |
| element = jQuery(i) | |
| res = block.call element, element | |
| break if res == false |
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
| @mixin font-size($font-size){ | |
| font-size:$font-size +px; | |
| font-size:$font-size / $base-font-size +rem; | |
| } |