Skip to content

Instantly share code, notes, and snippets.

View jineeshjohn's full-sized avatar

Jineesh jineeshjohn

View GitHub Profile
@jineeshjohn
jineeshjohn / gist:2763092
Created May 21, 2012 16:18
Colors supported by all major browsers
<style>
div.white{ background-color:white;}
div.yellow{ background-color:yellow;}
div.red{ background-color:red;}
div.fuscia{ background-color:#f0f;}
div.silver{ background-color:silver;}
div.gray{ background-color:gray;}
div.olive{ background-color:olive;}
div.purple{ background-color:purple;}
div.maroon{ background-color:maroon;}
@jineeshjohn
jineeshjohn / gist:2555702
Created April 30, 2012 05:14
String Concat first and last , second and second last ... using JavaScript
function foo(str){
var len = str.length, i = 0,j = len, arr = [];
var i = 0,j = len-1,half = Math.floor( len/2 );
while( i<half ){
arr.push(str[i]+str[j]);
i++;
j--;
}
if( len%2 == 1)
@jineeshjohn
jineeshjohn / gist:2044414
Last active December 5, 2018 18:59
Dynamic html table rows and column creation with jQuery
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<style>
table{
width:500px;
height:500px;
}
table td{
padding:10px;
margin:10px;
border:1px solid #ccc;
@jineeshjohn
jineeshjohn / event_delegation.html
Created November 20, 2011 06:47
Event delegation sample
<style>
#mytable{
border-bottom:1px solid #000;
border-right:1px solid #000;
}
#mytable td{
border-top:1px solid #000;
border-left:1px solid #000;
padding:15px;