@@ -60,11 +60,11 @@ export default class CIResponsive {
6060 const windowScreenBecomesBigger = this . innerWidth < window . innerWidth ;
6161
6262 if ( isUpdate ) {
63- images = document . querySelectorAll ( ' img[ci-src]' ) ;
64- backgroundImages = document . querySelectorAll ( '[ci-bg-url]' ) ;
63+ images = document . querySelectorAll ( ` img[${ this . config . imgSelector } ]` ) ;
64+ backgroundImages = document . querySelectorAll ( `[ ${ this . config . imgSelector } ]` ) ;
6565 } else {
66- images = filterImages ( document . querySelectorAll ( ' img[ci-src]' ) , 'ci-image' ) ;
67- backgroundImages = filterImages ( document . querySelectorAll ( '[ci-bg-url]' ) , 'ci-bg' ) ;
66+ images = filterImages ( document . querySelectorAll ( ` img[${ this . config . imgSelector } ]` ) , 'ci-image' ) ;
67+ backgroundImages = filterImages ( document . querySelectorAll ( `[ ${ this . config . imgSelector } ]` ) , 'ci-bg' ) ;
6868 }
6969
7070 if ( images . length > - 1 ) {
@@ -83,8 +83,9 @@ export default class CIResponsive {
8383 getBasicInfo = ( imgNode , isUpdate , windowScreenBecomesBigger , type ) => {
8484 const isImage = type === 'image' ;
8585 const { config } = this ;
86- const { baseURL, lazyLoading, presets, devicePixelRatioList, minLowQualityWidth } = config ;
87- const imgProps = isImage ? getImageProps ( imgNode ) : getBackgroundImageProps ( imgNode ) ;
86+ const { baseURL, lazyLoading, presets, devicePixelRatioList, minLowQualityWidth, imgSelector, bgSelector } = config ;
87+ const imgProps = isImage ?
88+ getImageProps ( imgNode , imgSelector ) : getBackgroundImageProps ( imgNode , bgSelector ) ;
8889 const { params, imgNodeSRC, isLazyCanceled, sizes, isAdaptive, preserveSize, minWindowWidth } = imgProps ;
8990
9091 if ( ! imgNodeSRC ) return ;
0 commit comments