Skip to content

Instantly share code, notes, and snippets.

View Takaya213's full-sized avatar
🎯
Focusing

Nicole Lambon Takaya213

🎯
Focusing
View GitHub Profile
@aaronwaldon
aaronwaldon / 1) readme.md
Last active May 13, 2021 09:26
How to set up Gulp for Compass compilation and minification, JavaScript minification, livereloading, and use with ExpressionEngine.

How to set up Gulp with an ExpressionEngine project

I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).

Install Node.js

  • If Node is not yet installed on the machine, it will need to be installed

Install Gulp (if needed)

@Takaya213
Takaya213 / equal-height.js
Created July 5, 2013 08:37
Make elements have the same height.
$.fn.equalizeHeights = function() {
var maxHeight = this.map(function(i,e) {
return $(e).height();
}).get();
return this.height( Math.max.apply(this, maxHeight) );
};
$('.equal').equalizeHeights();
@Takaya213
Takaya213 / fixed-header.js
Last active December 17, 2015 19:39
Fixed the header/nav to the top of the page in a slightly different style via a class.
function scrolled_menu() {
if ($(window).scrollTop() > $('header').height()) {
$('header').addClass('fixed_type');
$('html').addClass('fixed_type_html');
} else {
$('header').removeClass('fixed_type');
$('html').removeClass('fixed_type_html');
}
}
@Takaya213
Takaya213 / scroll-to-top.js
Last active May 3, 2017 10:01
Show and hide a scroll to top of page button, depending on where you are on the page.
$(window).scroll(function() {
if ($(this).scrollTop()) {
$('#toTop:hidden').stop(true, true).fadeIn();
} else {
$('#toTop').stop(true, true).fadeOut();
}
});
$(document).ready(function(){
$('#toTop').fadeOut();
@Takaya213
Takaya213 / watermark.js
Created May 2, 2013 07:57
A watermark effect for input boxes.
(function($) {
$.fn.watermark = function() {
return this.each(function() {
var obj = $(this);
var initialText = obj.val();
obj.focus(function() {
if (obj.val() === initialText)
obj.val("");
@Takaya213
Takaya213 / scroll-effect.js
Created May 2, 2013 07:54
An easy way to create a scroll effect on pages from one anchor to another.
$(document).ready(function(){
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
});
@Takaya213
Takaya213 / show-hide-password.js
Created May 2, 2013 07:53
A jQuery method to show and hide passwords in forms.
$(document).ready(function(){
$('.showpassword').each(function (index, input){
var $input = $(input);
$("#passwordshow").click(function () {
var change = $(this).is(":checked") ? "text" : "password";
var text = $(this).is(":checked") ? "Hide Password" : "Show Password";
var rep = $("<input type='" + change + "' />")
.attr("id", $input.attr("id"))
.attr("name", $input.attr("name"))
.attr('class', $input.attr('class'))