Latest 100 public snipts »
curosio's
snipts
showing 1-16 of 16 snipts
-
∞ New window jQuery
$(function(){ $('a.new-window').click(function(){ window.open(this.href); return false; }); });
-
∞ link like button
a:active { position: relative; top: 1px; }
-
∞ New clearfix
/* new clearfix */ .clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } * html .clearfix { zoom: 1; } /* IE6 */ *:first-child+html .clearfix { zoom: 1; } /* IE7 */
-
∞ RGB CSS Opacity
h1 { background: transparent url(black50.png); background: rgba(0, 0, 0, 0.5) none; } div { color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); border: 10px solid rgba(255, 255, 255, 0.3); }
-
∞ detect iphone
.htaccess #redirect mobile browsers RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$ RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301] Javascript <script language=javascript> <!– if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { location.replace("iphone-version.html"); } –> </script>
-
∞ movil snipts
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es-ES"> <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/> <link href="http://www.flickr.com/favicon.ico" rel="shortcut icon"> <style type="text/css">@import url("importscreen.css") screen;</style> <style type="text/css">@import url("importhandheld.css") handheld;</style> <link rel="stylesheet" type="text/css" media="screen" href="linkscreen.css" /> <link rel="stylesheet" type="text/css" media="handheld" href="linkhandheld.css" /> <meta name="HandheldFriendly" content="True" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=240"/> <meta name="viewport" content="initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <link media="only screen and (max-device-width: 480px)" href="/css/iphone.css" type="text/css" rel="stylesheet" />
-
∞ CDATA
/* <![CDATA[ */ /* ]]> */
-
∞ Image Rollover Borders
/*Inner Borders*/ #example-one a img, #example-one a { border: none; overflow: hidden; float: left; } #example-one a:hover { border: 3px solid black; } #example-one a:hover img { margin: -3px; } /*Outer Borders*/ #example-two a img, #example-two a { border: none; float: left; } #example-two a { margin: 3px; } #example-two a:hover { outline: 3px solid black; }
-
∞ inline block 4 all
li { width: 200px; min-height: 250px; border: 1px solid #000; display: -moz-inline-stack; /* FF2*/ display: inline-block; vertical-align: top; /* BASELINE CORRECCIÓN*/ margin: 5px; zoom: 1; /* IE7 (hasLayout)*/ *display: inline; /* IE */ _height: 250px; /* IE6 */ }
-
∞ css font size
body { font: normal 100%/1.375 Helvetica, Arial, sans-serif; /* 22px / 16px = 1.375 */ } h1 { font-family: Georgia, serif; font-size: 1.5em; line-height: 0.91667em; /* 22px / 24px = 0.91667em */ margin: 0.5em 0; } ul { font-size: 0.875em; /* 14px / 16px = 0.875em */ line-height: 1.28571; /* 18px / 14px = 1.28571 */ } li { margin-bottom: 0.42857em; /* 6px / 14px = 0.42857em */ }
-
∞ menu jquery dropdown
$(function(){ $("ul.dropdown li").hover(function(){ $(this).addClass("hover"); $('ul:first',this).css('visibility', 'visible'); }, function(){ $(this).removeClass("hover"); $('ul:first',this).css('visibility', 'hidden'); }); $("ul.dropdown li ul li:has(ul)").find("a:first").append(" » "); }); -------------------------------------------------- & the html <ul class="dropdown"> <li><a href="#">Lorem</a> <ul class="sub_menu"> <li><a href="#">Lorem</a></li> <li><a href="#">Lorem</a> <ul> <li><a href="#">Lorem</a></li> <li><a href="#">Lorem</a></li> </ul> </li> <li><a href="#">Lorem</a></li> <li><a href="#">Lorem</a></li> </ul> </li> </ul>
-
∞ reset css
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 helvetica,arial,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
-
∞ base CSS style
/* =============================================================== */ /* 00. base styles */ /* set base body ................................................. */ body {font:13px/1 arial,trebuchet MS,tahoma,helvetica,clean,sans-serif; background:#000; color:#fff;} /* general reset ................................................. */ * {margin:0; padding:0;} html, body, form, img, fieldset, legend, table, tbody, thead, tfoot, tr, th, td {border:none;} li {list-style:none;} /* hide elements from screen but not from source ................. */ .hidden {position:absolute !important; top:-999em; left:-999em;} /* clearfix class ................................................ */ .clearfix:after {content:"."; display:block; height:0; clear:both; visibility:hidden;} .clearfix {display:inline-block; display:block;}
-
∞ shortest way to test browser
//Firefox FF=/a/[-1]=='a' //Firefox 3 FF3=(function x(){})[-5]=='x' //Firefox 2 FF2=(function x(){})[-6]=='x' //IE IE='\v'=='v' //Safari Saf=/a/.__proto__=='//' //Chrome Chr=/source/.test((/a/.toString+'')) //Opera Op=/^function \(/.test([].sort) All: B=(function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown'
-
∞ transparent css all browsers
.transparent { filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; } new: .transparent { filter: alpha(opacity=50); /* internet explorer */ -khtml-opacity: 0.5; /* khtml, version anterior de safari */ -moz-opacity: 0.5; /* firefox, mozilla, netscape */ opacity: 0.5; /* safari, chrome, opera */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /*internet explorer 8 - gracias Andres */ }
-
∞ ie max & min width
/* Fallback if JavaScript is disabled */ width: 960px; /* JS-Expression for min-/max-width simulation */ width: expression((document.documentElement && document.documentElement.clientHeight) ? ((document.documentElement.clientWidth < 740) ? "740px" : ((document.documentElement.clientWidth > (80 * 16 * (parseInt(this.parentNode.currentStyle.fontSize) / 100))) ? "80em" : "auto" )) : ((document.body.clientWidth < 740) ? "740px" : ((document.body.clientWidth > (80 * 16 * (parseInt(this.parentNode.currentStyle.fontSize) / 100))) ? "80em" : "auto" ))); or the easyer with px: width:expression(document.body.clientWidth < 742? "740px" : document.body.clientWidth > 1070? "968px" : "auto") !important;


