Ticket #38395: 38395.5.patch
| File 38395.5.patch, 2.4 KB (added by , 9 years ago) |
|---|
-
src/wp-content/themes/twentyseventeen/assets/js/global.js
148 148 return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI ); 149 149 } 150 150 151 /** 152 * Test if an iOS device. 153 */ 154 function checkiOS() { 155 return /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream; 156 } 157 158 /* 159 * Test if background-attachment: fixed is supported. 160 * @link http://stackoverflow.com/questions/14115080/detect-support-for-background-attachment-fixed 161 */ 162 function supportsFixedBackground() { 163 var el = document.createElement('div'), 164 isSupported; 165 166 try { 167 if ( ! ( 'backgroundAttachment' in el.style ) || checkiOS() ) { 168 return false; 169 } 170 el.style.backgroundAttachment = 'fixed'; 171 isSupported = ( 'fixed' === el.style.backgroundAttachment ); 172 return isSupported; 173 } 174 catch (e) { 175 return false; 176 } 177 } 178 151 179 // Fire on document ready. 152 180 $( document ).ready( function() { 153 181 … … 184 212 if ( true === supportsInlineSVG() ) { 185 213 document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' ); 186 214 } 215 216 if ( true === supportsFixedBackground() ) { 217 document.documentElement.className += ' background-fixed'; 218 } 187 219 }); 188 220 189 221 // If navigation menu is present on page, adjust it on scroll and screen resize. -
src/wp-content/themes/twentyseventeen/style.css
3603 3603 max-height: 1200px; 3604 3604 } 3605 3605 3606 /* With panel images 100% of the screen height, we're going to fix the background image where supported to create a parallax-like effect. */ 3607 .background-fixed .panel-image { 3608 background-attachment: fixed; 3609 } 3610 3606 3611 .page-two-column .panel-content .entry-header { 3607 3612 float: left; 3608 3613 width: 36%; … … 3993 3998 } 3994 3999 } 3995 4000 3996 @media screen and ( min-width: 85.45em ) {3997 3998 .panel-image {3999 background-attachment: fixed;4000 }4001 }4002 4003 4001 @media screen and ( max-width: 48.875em ) and ( min-width: 48em ) { 4004 4002 4005 4003 .admin-bar .site-navigation-fixed.navigation-top,