echo icon indicating copy to clipboard operation
echo copied to clipboard

Is there any way to handle broken images?

Open AndrewEastwood opened this issue 10 years ago • 1 comments

for example If this had property 'replaceBrokenImagesWith' I would set any default image to show in place of broken images. it could be also callback function that is being invoked every time when error is occurred passing by broken image name and sets callback result into images' src attribute.

AndrewEastwood avatar Mar 17 '15 23:03 AndrewEastwood

@AndrewEastwood I did that may be it can help you:

echo.init({
      offset: 1000,
      throttle: 10,
      debounce: false,
      unload: false,
      callback: function(element, op) {
        element.onerror = function() {
          var ele = element;
          var notFoundClass = 'image-404';
          if (ele.className.indexOf(notFoundClass) == -1) {
            ele.src = 'data:image/png;base64,';
            ele.className = ele.className + ' ' + notFoundClass;
          }
        }
      }
    });

MohamedAlaa avatar Oct 15 '15 04:10 MohamedAlaa