Skip to content

Instantly share code, notes, and snippets.

View atatos's full-sized avatar

Mohamed ATATOUSSE atatos

View GitHub Profile
@atatos
atatos / IOS Detection
Created September 20, 2013 10:45
detect IOS version upper or lower than 5
function iOSversion() {
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
}
}
var ver = iOSversion();
if (ver && ver[0] <= 5) {
.checkbox {
background: url("../img/common/checkbox.png") no-repeat scroll 0 0 transparent;
cursor: pointer;
float: left;
height: 11px;
margin: 0 5px 0 0;
position: relative;
width: 11px;
}
@atatos
atatos / radio.css
Last active December 21, 2015 17:39
This code can be used for skinned input type radiobutton
.radiobox {
background: url("../img/common/radiobox.png") no-repeat scroll 0 0 transparent;
cursor: pointer;
display: inline-block;
float: left;
height: 11px;
margin: 0 5px 0 0;
position: relative;
width: 11px;
}
@atatos
atatos / Autocomplete JSON & Bold Hightlighted
Created July 27, 2013 17:30
this is an example of the autocomplete jQuery ui ( JSON & Bold hightlighted)
$("#search-txt").autocomplete({
source: function (req, responseFn) {
$.ajax({
url: "/search.json",
dataType: "json",
success: function(data) {
var re = $.ui.autocomplete.escapeRegex(req.term);
var matcher = new RegExp( "^" + re, "i" );
@atatos
atatos / browser detect
Created July 26, 2013 10:24
Detecting browsers in jQuery 1.9
//Bring back the browser object
jQuery.browser = {};
//Rest all is self explanatory.
jQuery.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase())
&& !/webkit/.test(navigator.userAgent.toLowerCase());
jQuery.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
jQuery.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
jQuery.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
@atatos
atatos / CSS Comment
Created March 23, 2013 01:56
This is comment for css
/* ||||||||||||||||||||||||||||||*/
------------------------------
/* == GLOBAL */
------------------------------
/* ||||||||||||||||||||||||||||||*/
@atatos
atatos / font-face
Created March 20, 2013 09:24
font-face
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@atatos
atatos / HTML5
Last active December 15, 2015 02:19
HTML5 Structure
<!DOCTYPE html>
<!--[if IE 8 ]> <html lang="fr" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="fr" class="ie9"> <![endif]-->
<!--[if IE 9 ]> <html lang="fr" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">