Changeset 39297
- Timestamp:
- 11/18/2016 08:10:18 PM (7 years ago)
- Location:
- trunk/src/wp-content/themes/twentyseventeen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyseventeen/assets/js/global.js
r39225 r39297 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() { … … 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 -
trunk/src/wp-content/themes/twentyseventeen/style.css
r39285 r39297 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; … … 3991 3996 .twentyseventeen-front-page .entry-content blockquote.alignright { 3992 3997 margin-right: -20%; 3993 }3994 }3995 3996 @media screen and ( min-width: 85.45em ) {3997 3998 .panel-image {3999 background-attachment: fixed;4000 3998 } 4001 3999 }
Note: See TracChangeset
for help on using the changeset viewer.