Как создать изображение круга в файле pug / css

    jQuery.preloadImage=function(src,onSuccess,onError)
    {
        var img = new Image()
        img.src=src;
        var error=false;
        img.onerror=function(){
            error=true;
            if(onError)onError.call(img);
        }
        if(error==false)    
        setTimeout(function(){
            if(img.height>0&&img.width>0){ 
                if(onSuccess)onSuccess.call(img);
                return img;
            }   else {
                setTimeout(arguments.callee,5);
            }   
        },0);
        return img; 
    }

    jQuery.preloadImages=function(arrayOfImages){
        jQuery.each(arrayOfImages,function(){
            jQuery.preloadImage(this);
        })
    }
 // example   
    jQuery.preloadImage(
        'img/someimage.jpg',
        function(){
            /*complete
            this.width!=0 == true
            */
        },
        function(){
            /*error*/
        }
    )
1
задан Emily McMullin 16 January 2019 в 17:06
поделиться

1 ответ

Вместо использования радиуса границы, как насчет использования пути обрезки над изображением?

.teamImage { clip-path: circle(50% at 50% 50%) ; }

Более подробная информация здесь: https://developer.mozilla.org/en-US / документы / Web / CSS / клип путь

0
ответ дан Kerri 16 January 2019 в 17:06
поделиться