File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
public_html/wp-content/mu-plugins Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ function canonical_link_past_home_pages_to_current_year() {
66
66
*/
67
67
function add_notification_styles () { ?>
68
68
<style type="text/css">
69
- html:not(#specificity-hack) {
69
+ html:not(#specificity-hack),
70
+ .wordcamp-latest-site-notify-fixed-position-fix {
70
71
/* 44 = 10px x2 for padding, 24px for line height. */
71
72
margin-top: calc(44px + var(--wp-admin--admin-bar--height, 0px)) !important;
72
73
}
@@ -105,6 +106,23 @@ function add_notification_styles() { ?>
105
106
color: #72aee6;
106
107
}
107
108
</style>
109
+ <script>
110
+ document.addEventListener("DOMContentLoaded", (event) => {
111
+ const fixedElements = document.querySelectorAll('nav, nav *'); // Select all elements
112
+ const fixedElementsArray = Array.from(fixedElements);
113
+
114
+ const fixedElementsWithPositionFixed = fixedElementsArray.filter(element => {
115
+ const computedStyle = getComputedStyle(element);
116
+ return computedStyle.position === 'fixed';
117
+ });
118
+
119
+ console.log(fixedElementsWithPositionFixed);
120
+
121
+ fixedElementsWithPositionFixed.forEach(element => {
122
+ element.classList.add('wordcamp-latest-site-notify-fixed-position-fix')
123
+ });
124
+ });
125
+ </script>
108
126
<?php }
109
127
110
128
/**
You can’t perform that action at this time.
0 commit comments