1// Per tutte le immagini singole all'interno di un post. 2let importElements = document.querySelectorAll( '.post__content img' ); 3importElements.forEach( ( node, index ) => { 4 node.setAttribute( 'data-fancybox', 'fancybox-import-' + index ); 5} ); 6 7// Per ogni galleria. 8let galleries = document.querySelectorAll( '.wp-block-gallery' ); 9galleries.forEach( ( node, index ) => { 10 let subnodes = node.querySelectorAll( '.wp-block-image img' ); 11 subnodes.forEach( ( subnode ) => { 12 subnode.setAttribute( 'data-fancybox', 'fancybox-gallery-' + index ); 13 } ); 14} ); 15 16// Per i prodotti nello shop 17let prodotti = document.querySelectorAll( 18 '.woocommerce-product-gallery__image img' 19); 20 21prodotti.forEach( ( node, index ) => { 22 node.setAttribute( 'data-fancybox', 'fancybox-prodotto-' + index ); 23} ); 24 25let productImages = document.querySelectorAll( 26 '.woocommerce-tabs.wc-tabs-wrapper img' 27); 28 29productImages.forEach( ( node, index ) => { 30 node.setAttribute( 'data-fancybox', 'fancybox-img-prodotto-' + index ); 31} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.