Skip to content

Instantly share code, notes, and snippets.

View vedranjaic's full-sized avatar

Vedran Jaic vedranjaic

  • NEOS
  • Zagreb, Croatia
View GitHub Profile
@vedranjaic
vedranjaic / document_ready.js
Created May 26, 2013 17:41
jQ: document.ready()
$(document).ready(function() {
// put all your jQuery goodness in here.
});
@vedranjaic
vedranjaic / scroll_top.js
Created May 26, 2013 17:43
jQ: Scroll to top
$(document).ready(function(){
$("#ANCHOR_ID").click(function(){
$('html, body').animate({
scrollTop: '0px'
},
500);
return false;
})
});
@vedranjaic
vedranjaic / iphone_prevent_font_scaling.css
Created May 26, 2013 17:44
css: Prevent font resize on landscape - iOS/WinMobile
/* prevent font scaling in landscape */
@media screen and (max-device-width:480px) {
html {
-webkit-text-size-adjust: none;
-ms-text-size-adjust:none;
}
}
@vedranjaic
vedranjaic / printing_acronyms.css
Created May 26, 2013 17:45
css: Printing acronyms with content from title tag
acronym:after {
content: " (" attr(title) ")";
}
@vedranjaic
vedranjaic / rwd_embeded_videos.css
Created May 26, 2013 17:46
css: Responsive embeded videos
/* wrap <iframe> in a div */
.responsive-video {
position: relative;
padding-bottom: 56.25%; /* 16/9 ratio */
padding-top: 30px; /* IE6 workaround*/
height: 0;
overflow: hidden;
}
.responsive-video iframe,
.responsive-video object,
@vedranjaic
vedranjaic / rwd_facebook_like_box.css
Created May 26, 2013 17:47
css: Responsive Facebook like box
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
/* To fill the container and nothing else */
.fb_iframe_widget, .fb_iframe_widget span, .fb_iframe_widget span iframe[style] {
width: 100% !important;
}
@vedranjaic
vedranjaic / word_wrap.css
Created May 26, 2013 17:49
css: Word-wrap
pre {
white-space: pre; /* CSS 2.0 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */
}
@vedranjaic
vedranjaic / placeholder_text_style.css
Created May 26, 2013 17:51
css: HTML5 - Style Placeholder Text
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
@vedranjaic
vedranjaic / iphone_disable_default_form_style.css
Created May 26, 2013 17:52
css: iPhone - Disabling default appearance of form elements on iOS
input, textarea {
-webkit-appearance: none;
}
@vedranjaic
vedranjaic / page_break_in_print.css
Created May 26, 2013 17:54
css: Page break for @media print
/* Break Page on print */
@media print {
#div {
page-break-before: always;
}
}