Skip to content

Instantly share code, notes, and snippets.

View treykane's full-sized avatar

Trey Kane treykane

View GitHub Profile

Keybase proof

I hereby claim:

  • I am treykane on github.
  • I am treykane (https://keybase.io/treykane) on keybase.
  • I have a public key ASAsh63tvBHtfNWTYRu9RhxkhtnnK7_az16qKvPnV0_SbQo

To claim this, I am signing this object:

@treykane
treykane / sticky.css
Last active September 29, 2016 18:55
JQuery - Sticky Element on scroll when it reaches the top of the browser window
.is-sticky {
position: fixed; /* why it sticks */
top: 0; /* can be adjusted as needed */
margin: 0;
z-index: 999; /* be on top of all the things */
}/* is-sticky */
@treykane
treykane / cookie-n-stuff.js
Created June 24, 2016 16:03
Do some stuff based on the status of a cookie
@treykane
treykane / fake-border-radius.scss
Created January 6, 2016 13:56
Border on element with border radius 50% - border is faked
//Red Circle Background
.circle-red{
@include linear-gradient(#E71323, #5D0006);
border-radius: 50%;
box-shadow: ;
width: 250px;
height: 250px;
z-index: 1;
&:after { //BORDERS WITH BORDER RADUIS WORK AROUND
@include linear-gradient(#FB323C, #990007);
@treykane
treykane / hr-lines-on-sides-of-title.scss
Last active January 6, 2016 13:54
Horizontal Lines on each side of title - DON'T FORGET TO HIDE YOUR OVERFLOW
.hero-cta-title {
display: inline-block;
position: relative;
&:before, &:after {
content: "";
position: absolute;
border-top: 1px solid white;
top: 9px;
width: 200%;
}//. &:before, &:after
@treykane
treykane / Click to activate (jQuery).markdown
Last active December 17, 2015 19:33
Click to activate (jQuery)

Click to activate (jQuery)

Simple click to activate demo with jQuery. Allows the user to click the element to toggle it on or off, or click anywhere to deactivate.

Using "Excluded Areas" to allow user interaction with the revealed content.

A Pen by Trey Kane on CodePen.

License.

@treykane
treykane / toggle-class-on-stuff.js
Last active October 10, 2021 20:28
Toggle a class, and remove the class when you click ANYWHERE ELSE on the document.
$( document ).ready(function() {
$(function() { // TOGGLE CLASS ON ELEMENT
$(".tile-top").on("click", function() {
$(this).toggleClass('active'); });
}); //END TOGGLE CLASS
$(function() { // REMOVE CLASS WHEN YOU CLICK, EXCLUDE ELEMENTS
var ignore= Array(".tile-top", // elements to ignore
".tile-bottom");
@treykane
treykane / set-cookie.js
Last active October 5, 2016 16:22
Set a basic cookie with JS
@treykane
treykane / AJAX-Response-Handling.js
Last active December 17, 2015 15:48
Parse and handle a basic AJAX response.
$.post("ajax_rope_check.php", { //FORM AJAX
street: s.step_two_street.val(),
city: s.step_two_city.val(),
state: s.step_two_state.val(),
zip: s.step_two_zip.val()
})
.done(function(response){ //AJAX RESPONSE
response = $.parseJSON(response);//CHANGE STR TO OBJ
if(response.serviceable === true) {
@treykane
treykane / Modal-Animation-&-Check-Fields-For-Value.js
Last active December 17, 2015 15:49
Animate a modal transition, with step counter.
var modal_steps = (function() {
// variables
var s = {
step_one: $('.address-check__step.step-1'),
step_two: $('.address-check__step.step-2'),
step_three: $('.address-check__step.step-3'),
step_one_bar_mask: $('.js-step-bar-1 .bar-mask'),
step_two_bar_mask: $('.js-step-bar-2 .bar-mask'),
step_one_circle: $('.step-circle.circle-1'),