Skip to content

Instantly share code, notes, and snippets.

View alvarotrigo's full-sized avatar

Álvaro alvarotrigo

View GitHub Profile
@alvarotrigo
alvarotrigo / index.html
Created August 27, 2015 11:30
Offset canvas push menu
<div id="offmenu">
<ul>
<li>aaa</li>
<li>aaa</li>
<li>aaa</li>
<li>aaa</li>
</ul>
</div>
<i id="push" class="fa fa-bars"></i>
@alvarotrigo
alvarotrigo / Reset CSS
Created October 3, 2014 09:49
Reset CSS
/* Reset CSS
* --------------------------------------- */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
form,fieldset,input,textarea,p,blockquote,th,td {
padding: 0;
margin: 0;
}
a{
text-decoration:none;
}
@alvarotrigo
alvarotrigo / requestAnimation.js
Last active August 29, 2015 14:27
requestAnimationFrame IE < 10
window.requestAnimFrame = function(){
return window.requestAnimationFrame || function(callback){ callback() }
}();
//usage
requestAnimFrame(function(){
//do whatever
});
var data ={};
var self ={};
for(var key in data) {
if(!self.hasOwnProperty(key)) {
self[key] = data[key];
}
}
function User(userData) {
userData = userData || {};
this.name = ko.observable(userData.name);
//copying all non existent properties
for(var key in userData) {
if(!self.hasOwnProperty(key)) {
self[key] = userData[key];
}
<?xml version="1.0"?>
<!--
IE5 default style sheet, provides a view of any XML document
and provides the following features:
- auto-indenting of the display, expanding of entity references
- click or tab/return to expand/collapse
- color coding of markup
- color coding of recognized namespaces - xml, xmlns, xsl, dt
This style sheet is available in IE5 in a compact form at the URL
<?xml version="1.0"?>
<!--
IE5 default style sheet, provides a view of any XML document
and provides the following features:
- auto-indenting of the display, expanding of entity references
- click or tab/return to expand/collapse
- color coding of markup
- color coding of recognized namespaces - xml, xmlns, xsl, dt
This style sheet is available in IE5 in a compact form at the URL
$(document).ready(function() {
$('#fullpage').fullpage({
autoScrolling: false,
fitToSection: false
});
});
@alvarotrigo
alvarotrigo / iscroll.js handler for fullpage.js
Created November 20, 2015 10:01
iscroll.js handler for fullpage.js
// We only want the iScroll to translate on touch devices.
// On overscroll, at least on iPhone, it seems to trigger a window
// scroll event which allows moving to the next section.
// If that doesn't happen, we would need to incorporate iscroll-probe
// to get access to the onscroll event and do our own determining of
// whether or not to move to the next fullpage section.
var iscrollOptions = {
disableMouse: true,
@alvarotrigo
alvarotrigo / gist:4a87a4b8757d87df8a72
Last active September 27, 2016 15:25
pagePiling structure
<div id="pagepiling">
<div class="section">Some section</div>
<div class="section">Some section</div>
<div class="section">Some section</div>
<div class="section">Some section</div>
</div>