Skip to content

Instantly share code, notes, and snippets.

View gpassarelli's full-sized avatar

Gabriel Passarelli gpassarelli

View GitHub Profile
@gpassarelli
gpassarelli / gist:2134720
Created March 20, 2012 12:34
CSS: Prevent Bounce Scroll in Lion
html, body {
height: 100%;
overflow: hidden;
height: 100%;
}
@gpassarelli
gpassarelli / gist:2134845
Created March 20, 2012 12:42
CSS: Horizontal Centered List
#centeredmenu {
float:left;
width:100%;
overflow:hidden;
position:relative;
}
#centeredmenu ul {
clear:left;
float:left;
list-style:none;
@gpassarelli
gpassarelli / gist:2134851
Created March 20, 2012 12:42
CSS: File Type Icon
a[href^="http:"] {
display:inline-block;
padding-right:14px;
background:transparent url(/Images/ExternalLink.gif) center right no-repeat;
}
a[href^="mailto:"] {
display:inline-block;
padding-left:20px;
line-height:18px;
background:transparent url(/Images/MailTo.gif) center left no-repeat;
@gpassarelli
gpassarelli / gist:2134856
Created March 20, 2012 12:42
CSS: Min-Height
selector {
min-height:500px;
height:auto !important;
height:500px;
}
@gpassarelli
gpassarelli / gist:2134863
Created March 20, 2012 12:43
CSS: Remove Dotted Link Borders
a,a:active {
outline: none;
}
@gpassarelli
gpassarelli / gist:2134873
Created March 20, 2012 12:43
CSS: Print URL After Links
@media print{
a:after{content:" (" attr(href) ") ";font-size:0.8em;font-weight:normal;}
}
@gpassarelli
gpassarelli / gist:2134882
Created March 20, 2012 12:43
CSS: Set color of selected text
::selection {
background: #ffb7b7; /* Safari */
}
::-moz-selection {
background: #ffb7b7; /* Firefox */
}
@gpassarelli
gpassarelli / gist:2134886
Created March 20, 2012 12:44
CSS: CSS Tooltips
a:hover {
background:#ffffff;
text-decoration:none;} /*BG color is a must for IE6*/
a.tooltip span {
display:none;
padding:2px 3px;
margin-left:8px;
width:130px;
@gpassarelli
gpassarelli / gist:2134927
Created March 20, 2012 12:46
jQuery: Make Entire Div Clickable
$(".myBox").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
@gpassarelli
gpassarelli / gist:2134931
Created March 20, 2012 12:47
jQuery: Open External Links In New Window
$('a').each(function() {
var a = new RegExp('/' + window.location.host + '/');
if(!a.test(this.href)) {
$(this).click(function(event) {
event.preventDefault();
event.stopPropagation();
window.open(this.href, '_blank');
});
}
});