When working properly, a pinned div would look something like:
Today, I was experimenting with webp images and using Modernizr to switch out between standard images/webp based on browser functionality, and found that it broke the pinning functionality - the same div now looks like:
This is the bit of script being used to switch images out
Modernizr.on('webp', function (result) {
// result == Modernizr.webp
console.log(result); // either true or false
if (result) {
// WebP Support
$(".webpImage").queue(function() {
var webp = $(this).attr('data-webp');
$(this).attr('src', webp)
})
}
else {
// No WebP support
$(".webpImage").queue(function() {
var nowebp = $(this).attr('data-img-fallback');
$(this).attr('src', nowebp)
})
}
});
When working properly, a pinned div would look something like:
Today, I was experimenting with webp images and using Modernizr to switch out between standard images/webp based on browser functionality, and found that it broke the pinning functionality - the same div now looks like:
This is the bit of script being used to switch images out
Modernizr.on('webp', function (result) {
//
result == Modernizr.webpconsole.log(result); // either
trueorfalseif (result) {
// WebP Support
$(".webpImage").queue(function() {
var webp = $(this).attr('data-webp');
$(this).attr('src', webp)
})
}
else {
// No WebP support
$(".webpImage").queue(function() {
var nowebp = $(this).attr('data-img-fallback');
$(this).attr('src', nowebp)
})
}
});