Skip to content

Instantly share code, notes, and snippets.

View Takaya213's full-sized avatar
🎯
Focusing

Nicole Lambon Takaya213

🎯
Focusing
View GitHub Profile
@Takaya213
Takaya213 / responsive-table.css
Last active October 6, 2016 08:08
Responsive Tables
table#miyazaki {
margin: 0 auto;
border-collapse: collapse;
font-family: Agenda-Light, sans-serif;
font-weight: 100;
background: #333; color: #fff;
text-rendering: optimizeLegibility;
border-radius: 5px;
}
@Takaya213
Takaya213 / MetaTags.html
Last active October 6, 2016 08:06
Meta Tags
<!-- UX Compatible Meta Tag -->
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<!-- Viewport Meta Tag -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Favicon Meta Tag -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/images/general/favicon.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/images/general/favicon.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/images/general/favicon.png" />
@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'))