Skip to content

Instantly share code, notes, and snippets.

View adrianrodriguez's full-sized avatar
💭
Looking for work

Adrian Rodriguez adrianrodriguez

💭
Looking for work
View GitHub Profile
@adrianrodriguez
adrianrodriguez / button.sass
Last active December 11, 2015 22:08
Weird syntax error with sass mixin.
@mixin button($color1, $color2, $padding, $size, $radius)
+background(linear-gradient(#{$color1}, #{$color2}))
color: $white
text-shadow: -1px 0px 0px $header
padding: #{$padding}
text-transform: uppercase
display: inline-block
text-align: center
font-size: #{$size}
cursor: pointer
$(function() {
// Get first element and find element within and hide
$(".grid_3:first").find(".prev").hide();
/// Get last element and find element within and hide
$(".grid_3:last").find(".next").hide();
$(function() {
$(".grid_3").each(function(){
// .next finds the next Dom element in this case it would be another grid_3 element
var next = $(this).next();
var prev = $(this).prev();
// Store this current element into a var called "that" so that "this" can be used in it's own handler
@adrianrodriguez
adrianrodriguez / parse.js
Created October 19, 2011 15:42
Parse integer from parent class name
// So I am attempting to target the parent class name of the .next element and store the number.
$(function(){
$(".next").parseInt($(this).parent().attr("class"));
});
@adrianrodriguez
adrianrodriguez / incrementalclasses.js
Last active September 27, 2015 16:07
Add incremental numbers as classes to an element.
$(function() {
var i = 0;
$(".foo:first-child").addClass("post-" + i);
$(".foo").each(function(){
$(this).addClass("post-" + i++);
});
@adrianrodriguez
adrianrodriguez / classname.html.haml
Created July 28, 2011 20:14
Adding multiple html attributes in rails
-# I'm trying to add another attribute to this link, but having trouble figuring out how to do it
-# For example, I want to add :style => "display: none" to this line
%strong= link_to "view this", current_user, :class => "public-on"
@adrianrodriguez
adrianrodriguez / cssbutton.html
Created July 19, 2011 14:12
Pure CSS Button
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<style type="text/css" media="screen">
.wrapper {
width: 100px;
@adrianrodriguez
adrianrodriguez / modal.js
Created June 23, 2011 15:26
Trying to add a class to a modal generated by a plugin when clicking an anchor
// I am using a prettyPhoto plugin for a modal
//and I want to add a class to only certain modals by using only anchors with the .lower class as the trigger
// How do I add a class to say... ('.pic_holder') after I have clicked on the trigger
$("a.lower[rel^='prettyPhoto']").prettyPhoto({
default_width: 480,
});
// Found a solution, prettyPhoto had some callback functions. Just learning something new:
//Yannick's lack of interest in the Captain America movie just got him slapped, epic style:
$(function(){
$('#adrian').slap(function(){ // initiate slap
$("#yannick").face(10000); // slow motion slap
return true; // loop that sucka << this may be wrong, but the animation don't gotta stop....
});
});