body {
background: #FFF;
color: #333;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-font-smoothing: antialiased;
}
.viewport-content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.scroll {
overflow: auto !important;
}
.content-main {
padding-top: 70px;
}
.list.list-default ul {
padding: 0;
margin: 0;
font-size: 16px;
line-height: 1.5;
font-weight: 400;
overflow: hidden;
}
.together.list.list-default ul {
font-size: 1em;
line-height: 1.25;
}
.list.list-default ul > li {
list-style: none;
border-bottom: 1px solid rgba(51, 51, 51, 0.2);
padding: 15px 10px 15px 10px;
position: relative;
cursor: pointer;
}
.list.list-default ul > li.linked {
padding-right: 44px;
}
.list.list-default ul > li .list-image {
width: 50px;
height: 50px;
position: absolute;
left: 10px;
top: 50%;
margin-top: -25px;
border-radius: 17%;
background-position: center center;
background-size: cover;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
}
.list.list-default ul > li .list-title {
font-size: 1em;
font-weight: 600;
margin: 0;
}
.list.list-default ul > li p {
margin: 0;
}
.list.list-default ul > li .list-title + p {
margin-top: .5em;
}
.list.list-default ul > li .list-title + p.text-danger {
margin-top: 0;
font-size: 0.8em;
}
.list.list-default ul > li .icon {
position: absolute;
width: 44px;
top: 0;
bottom: 0;
right: 0;
font-family: FontAwesome;
cursor: pointer;
}
.list.list-default ul > li .icon:after {
content: "\f105";
display: block;
text-align: center;
font-size: 30px;
line-height: 54px;
position: absolute;
width: 44px;
top: 50%;
margin-top: -27px;
right: 0;
color: #333;
}
.list.list-default ul > li.download .icon:after {
content: "\f0ed";
font-size: 20px;
color:...
JavaScript
var request = true; // CHANGE THIS TO SEE ERROR MESSAGE EXAMPLE - BOOLEAN
var offlineDevice = false; // CHANGE THIS TO SEE THE OFFLINE EXAMPLE
// FUNCTION TO DISPLAY THE OFFLINE NOTIFICATION OR REMOVE IT
function checkOnline(offline) {
if ( offline ) {
$('.list .helper.app-offline-notification').addClass('active');
$('.list .helper.app-offline-notification').fadeIn(500);
} else {
if ( $('.list .helper.app-offline-notification').hasClass('active') ) {
$('.list .helper.app-offline-notification').removeClass('active');
$('.list .helper.app-offline-notification').fadeOut(500);
}
}
}
function downloadApp(fakeRequest) {
return request ? Promise.resolve() : Promise.reject()
}
$('li.download').on('click', function(e) {
var _this = $(this);
checkOnline(offlineDevice);
// IF OFFLINE SHOW MESSAGE THAT DEVICE IS OFFLINE ON THE APP THE USER CLICKS - THEN REMOVES IT
if (offlineDevice) {
_this.find('.list-desc').append($('<p class="text-danger">Connect to the internet to download the app.</p>').hide().fadeIn(500));
setTimeout(function() {
_this.find('.text-danger').fadeOut(500).then(function() {
_this.find('.text-danger').remove();
});
}, 2000);
return;
}
if ( !$(e.target).is('.swipe-action') ){
if ( _this.hasClass('download') ) {
downloadApp(request).then(function onSuccess() {
var stopped = false;
_this.find('.progress').addClass('show fadeIn');
_this.removeClass('download').addClass('cancel');
_this.find('.progress-bar').animate({
width: "100%"
}, {
duration: 5000,
easing: "linear",
progress: function() {
if ( _this.hasClass('download') ) {
stopped = true;
return;
}
},
complete: function() {
if ( !stopped ) {
_this.find('.progress').removeClass('show fadeIn');
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.