Skip to content

Commit

Permalink
add fallback in non-supporting browser
Browse files Browse the repository at this point in the history
  • Loading branch information
tfirdaus committed Apr 25, 2015
1 parent e7ab190 commit 850d709
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
5 changes: 5 additions & 0 deletions css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ <h1>HTML5 Download Attribute</h1>
<div class="site-content cf">
<a class="btn btn-download" href="download/acme-doc-2.0.1.txt" download="Acme Documentation (ver. 2.0.1).txt">Download Text</a>
</div>

<script src="js/scripts.min.js"></script>
<script src="js/scripts.js"></script>
</body>
</html>
16 changes: 15 additions & 1 deletion js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
(function($) {
'use strict';


if ( ! Modernizr.adownload ) {

var $link = $('a');

$link.each(function() {
var $download = $(this).attr('download');

if (typeof $download !== typeof undefined && $download !== false) {
var $el = $('<div>').addClass('download-instruction').text('Right-click and select "Download Linked File"');
$el.insertAfter($(this));
}

});

}

})(jQuery);
7 changes: 0 additions & 7 deletions js/scripts.min.js

This file was deleted.

5 changes: 5 additions & 0 deletions less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ mark {
background-color: lighten(#00539F, 5%);
}
}
.download-instruction {
font-size: 12px;
margin-top: 20px;
color: darken(@body-bg, 30%);
}


@media screen and (min-width: 630px) {
Expand Down

0 comments on commit 850d709

Please sign in to comment.