Skip to content

Instantly share code, notes, and snippets.

View logeshpaul's full-sized avatar

Logesh Paul logeshpaul

View GitHub Profile
@logeshpaul
logeshpaul / disable-focus.css
Created April 29, 2014 08:14
Disable native focus on tablets and mobiles
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-tap-highlight-color: transparent;
-webkit-user-modify: read-write-plaintext-only;
@logeshpaul
logeshpaul / scrollDetect.js
Created April 24, 2014 05:30
Detect window scrolling
$(function(){
var _top = $(window).scrollTop();
var _direction;
$(window).scroll(function(){
var _cur_top = $(window).scrollTop();
if(_top < _cur_top)
{
_direction = 'down';
}
else
@logeshpaul
logeshpaul / css-browser-selector.js
Created July 30, 2013 01:25
JS: CSS Browser Selector
/*
CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m
@logeshpaul
logeshpaul / slider.js
Created July 23, 2013 07:50
JS - Simple JS Slider
$(document).ready(function() {
//Show the paging and activate its first link
$(".slider-paging").show();
$(".slider-paging a:first").addClass("active");
//Get size of the image, how many images there are, then determin the size of the image reel.
var imageWidth = $(".slide-holder").width();
var imageSum = $(".image-reel img").size();
var imageReelWidth = imageWidth * imageSum;
@logeshpaul
logeshpaul / html5shiv.html
Created July 5, 2013 11:47
HTML: HTML5shiv js
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@logeshpaul
logeshpaul / clearfix.css
Last active December 19, 2015 08:49
CSS: Clearfix
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
@logeshpaul
logeshpaul / module.css
Created July 3, 2013 11:14
CSS: Module
/*-------------------------------------------------
MODULE :: PAGE :: USER DASHBOARD
-------------------------------------------------*/
/*-------------------------------------------------
MODULE :: PAGE :: FAVORITES
-------------------------------------------------*/
@logeshpaul
logeshpaul / reset.css
Created July 3, 2013 10:25
CSS: Eric Meyer Reset CSS v2.0
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@logeshpaul
logeshpaul / fade-effect.css
Created May 24, 2013 10:25
Fade Effect on Link Hover
/* Hover CSS properties */
a {
color:blue;
/* First we need to help some browsers along for this to work.
Just because a vendor prefix is there, doesn't mean it will
work in a browser made by that vendor either, it's just for
future-proofing purposes I guess. */
-o-transition:.5s;
-ms-transition:.5s;
@logeshpaul
logeshpaul / method-1.js
Last active December 15, 2015 12:29
Run JavaScript Only After Entire Page Has Loaded
$(window).bind("load", function() {
// code here
});