This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture alt="Alt tag describing the image represented"> | |
<!--<source src="photo-s.jpg"/>--> | |
<source src="photo-s.jpg"/> | |
<!--<source src="photo-m.jpg" media="min-width:321px"/>--> | |
<source src="photo-m.jpg" media="min-width:321px"/> | |
<!--<source src="photo-l.jpg" media="min-width:641px"/>--> | |
<source src="photo-l.jpg" media="min-width:641px"/> | |
<!--<source src="photo-xl.jpg" media="min-width:1281px"/>--> | |
<source src="photo-xl.jpg" media="min-width:1281px"/> | |
<noscript><img src="photo-s.jpg"/></noscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS responsive images</title> | |
<style> | |
/* Doesn't stop original source image being | |
downloaded too */ | |
@media (min-device-width:600px) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta name='media' var='small' media='min-width:320px' /> | |
<meta name='media' var='small-2x' media='min-width:320px and min-device-pixel-ratio:2;' /> | |
<meta name='media' var='medium' media='min-width:600px' /> | |
<meta name='media' var='medium-2x' media='min-width:600px and min-device-pixel-ratio:2;' /> | |
<meta name='media' var='large' media='min-width:1000px' /> | |
</head> | |
<body> | |
<picture alt=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta name='srcset' var='small' value='320w' /> | |
<meta name='srcset' var='small-2x' value='320w 2x;' /> | |
<meta name='srcset' var='medium' value='600w' /> | |
<meta name='srcset' var='medium-2x' value='600w 2x;' /> | |
<meta name='srcset' var='large' value='1000w' /> | |
</head> | |
<body> | |
<img src="images/small/photo.jpg" srcset="images/{srcset}/photo.jpg" alt="The Breakfast Combo"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture alt=""> | |
<!-- If browser supports WebP, use image below: --> | |
<source src="fullsize.webp" type="image/webp"> | |
<!-- Else, use image from which ever source tag currently matches --> | |
<source src="mobile.jpg"> | |
<source src="medium.jpg" media="min-width: 600px"> | |
<source src="fullsize.jpg" media="min-width: 900px"> | |
<img src="mobile.jpg"> | |
</picture> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ReSRC = function() { | |
"use strict"; | |
function h(e, t, n) { | |
var r = new Array; | |
t == null && (t = document); | |
n == null && (n = "*"); | |
var i = t.getElementsByTagName(n), s = i.length, o = new RegExp("(^|\\s)" + e + "(\\s|$)"), u, a; | |
for (u = 0, a = 0; u < s; u++) if (o.test(i[u].className)) { | |
r[a] = i[u]; | |
a++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/github.tmtheme", | |
"font_face": "Courier New", | |
"font_size": 10, | |
"wide_caret": true, | |
"word_wrap": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Tested in: | |
Chrome - 22 : Works | |
FF - 16 : Works | |
IE - 10 | |
IE - 9 : Works | |
IE - 8 : no alert - check at home | |
IE - 7 : no alert - "" | |
IE - 6 : posts alert twice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery to JavaScript - src: http://sharedfil.es/js-48hIfQE4XK.html | |
//--------------------------------------------------// | |
$(document).ready(function() { | |
// code… | |
}); | |
document.addEventListener("DOMContentLoaded", function() { | |
// code… | |
}); |