Skip to content

Instantly share code, notes, and snippets.

View origamid's full-sized avatar

André origamid

View GitHub Profile
@origamid
origamid / dabblet.css
Created January 14, 2012 23:52
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@origamid
origamid / gist:7354118
Created November 7, 2013 12:52
JS: ScrollTop
$(".logo").click(function(e) {
e.preventDefault();
$('html, body').animate({
scrollTop: $("#home").offset().top
}, 1000);
});
@origamid
origamid / gist:7354147
Last active December 27, 2015 16:19
JS: Hide - SlideDown
$(function() {
$("div.portfolio__item").hide();
$("div.portfolio__item.espmjr").slideDown();
$("a.espmjr").parent().attr('id', 'ativado');
$('.clientes > li > a').each(function() {
$(this).css('display', 'block');
$(this).show(0).on('click', function(e) {
e.preventDefault();
$classe = $(this).attr('class');
$('ul.clientes > li').attr('id', '');
@origamid
origamid / gist:7354156
Last active December 27, 2015 16:19
JS: Ajax Form
$('form.contato__form').on('submit', function() {
var that = $(this),
url = that.attr('action'),
type = that.attr('method'),
data = {};
that.find('[name]').each(function(index, value) {
var that = $(this),
name = that.attr('name'),
value = that.val();
@origamid
origamid / gist:7354175
Last active December 27, 2015 16:19
JS: Visibility
Visibility.onVisible(function(){
var header = $('header'),
home = $('.home'),
homeH1 = $('.home h1'),
homeBlockquote = $('.home blockquote'),
homeButton = $('.home .origamid-button'),
mainH2 = $('main h2'),
child1 = $('main ul li.origami:nth-child(1)'),
child2 = $('main ul li.origami:nth-child(2)'),
@origamid
origamid / gist:7354181
Last active December 27, 2015 16:19
JS: Waypoint
$(document).ready(function() {
$('.main__ideal').waypoint(function() {
$('.main__ideal ul li').each(function(d){
$(this).delay(d * 150).fadeTo('slow', 1);
});
},
{
offset: '80%'
});
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php
@origamid
origamid / itemtoggle.js
Created March 13, 2014 21:32
Item Toggle
$(function() {
$('dd').hide();
$('dt').each(function() {
$(this).show(0).on('click', function(e) {
e.preventDefault();
$(this).toggleClass('active');
$(this).next('dd').slideToggle();
});
});
});
@origamid
origamid / galeriafotos.js
Created March 13, 2014 21:34
Galeria de Fotos
$(function() {
$(".projetos__lista-img > li:first-child > a").addClass("active");
$(".projetos__lista-img > li > a").hover(function(e) {
$(this).parent().parent().find("li > a").removeClass("active");
e.preventDefault();
$(this).addClass("active");
var linkImagem = $(this).attr("href");
var $imagemFinal = $(this).parent().parent().parent().parent();
$($imagemFinal).find(".projetos__img img").attr("src",linkImagem);
});
@origamid
origamid / headerfixo.js
Created March 13, 2014 21:34
Header Fixo Animado
$(document).scroll(function() {
if( $(this).scrollTop() > 100 ) {
$(".header-fixed").addClass("header-small");
} else if( $(this).scrollTop() < 100 ) {
$(".header-fixed").removeClass("header-small");
}
});