Skip to content

Instantly share code, notes, and snippets.

View adikahorvath's full-sized avatar
🏠
Working from home

Adam Horvath adikahorvath

🏠
Working from home
View GitHub Profile
@adikahorvath
adikahorvath / anchor.css
Created January 5, 2014 21:15
anchor link + fixed header problem with simple CSS
*{margin:0; padding:0; border:0; outline:none;}
html, body{font:normal 14px/1 'Segoe UI', Arial, serif; color:#333;}
p{margin:0 0 20px;}
.fixed{
position:fixed;
top:0;
left:0;
width:100%;
height:100px;
@adikahorvath
adikahorvath / cursor.css
Created January 5, 2014 21:21
Custom cursor with CSS
html{cursor:url('custom-cursor.png'), default;}
html.ie{cursor:url('custom-cursor.cur'), default;}
a{cursor:pointer;}
@adikahorvath
adikahorvath / closeLayer.js
Created January 5, 2014 21:34
close when click next to layer
$('.overlay').click(function(e){
if (e.target == e.currentTarget) {
$(this).hide();
}
});
@adikahorvath
adikahorvath / consolelog.js
Last active January 2, 2016 08:09
simpler console.log
function log(message) {
try {
console.log(message);
}
catch (e) {}
finally {
return;
}
}
@adikahorvath
adikahorvath / textarea.css
Created January 7, 2014 09:08
crossbrowser textarea
textarea {
overflow: auto;
min-height: 100px;
resize: vertical;
vertical-align: top;
}
@adikahorvath
adikahorvath / custom-webkit-scrollbar.css
Created January 7, 2014 15:38
custom webkit scrollbar
div {
height: 300px;
overflow-y: scroll;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
-webkit-border-radius: 10px;
border-radius: 10px;
@adikahorvath
adikahorvath / generated-content-click.js
Created January 9, 2014 09:20
generated content click
// ajax container clickable item
$('#ajax-container').on('click', 'span', function() {
console.log('works!');
});
@adikahorvath
adikahorvath / ie-hacks.css
Created January 11, 2014 12:03
IE CSS hacks
_color: red; /* IE6 */
*color: red; /* IE6, IE7 */
+color: red; /* ??? IE7 */
#color: red; /* ??? IE7 */
color: red\0; /* ??? IE8 */
color: red\9; /* lte IE9 */
@adikahorvath
adikahorvath / conditional-comments.html
Created January 11, 2014 12:50
conditional comments
<!--[if IEMobile 7 ]> <html class="ie-mobile"> <![endif]-->
<!--[if lte IE 7]> <html class="ie7"> <![endif]-->
<!--[if IE 8]> <html class="ie8"> <![endif]-->
<!--[if IE 9]> <html class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html> <!--<![endif]-->
<!-- IE 10+ drop conditional comments so -->
<script>
if (/*@cc_on!@*/false) {
document.documentElement.className+=' ie10';
@adikahorvath
adikahorvath / html5-ie.css
Created January 11, 2014 12:59
html5 ready for <=IE8
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
audio, canvas, video {
display: inline-block;
}