mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
top computed
This commit is contained in:
parent
1217578202
commit
6ee03b7ebb
@ -53,7 +53,8 @@ export default {
|
||||
bannerName: document.querySelector("#header-accompanying_course-name"),
|
||||
bannerDetails: document.querySelector("#header-accompanying_course-details"),
|
||||
stickyNav: null,
|
||||
sumBanner: null
|
||||
sumBanner: null,
|
||||
top: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -61,34 +62,28 @@ export default {
|
||||
return this.$store.state.accompanyingCourse
|
||||
},
|
||||
top() {
|
||||
//return window.getComputedStyle(this.stickyNav).getPropertyValue('top'); //
|
||||
return 30; //px
|
||||
return parseInt(window.getComputedStyle(this.stickyNav).getPropertyValue('top').slice(0, -2));
|
||||
},
|
||||
//sumBanner() {
|
||||
// return this.header.offsetHeight + this.bannerName.offsetHeight + this.bannerDetails.offsetHeight;
|
||||
//}
|
||||
},
|
||||
mounted() {
|
||||
this.ready();
|
||||
window.addEventListener('scroll', this.handleScroll); // scroll de la souris
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('scroll', this.handleScroll); // scroll de la souris
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
ready() {
|
||||
|
||||
// when mounted ready
|
||||
this.stickyNav = document.querySelector('#navmap');
|
||||
this.sumBanner = this.header.offsetHeight + this.bannerName.offsetHeight + this.bannerDetails.offsetHeight;
|
||||
|
||||
const resizeObserver = new ResizeObserver(entries => { // FF/Chrome!
|
||||
|
||||
console.log('header', this.header.offsetHeight);
|
||||
//this.header = this.header.offsetHeight;
|
||||
console.log('bannerName', this.bannerName.offsetHeight);
|
||||
//this.bannerName = this.bannerName.offsetHeight;
|
||||
console.log('bannerDetails', this.bannerDetails.offsetHeight);
|
||||
//this.bannerDetails = this.bannerDetails.offsetHeight;
|
||||
|
||||
this.sumBanner = this.header.offsetHeight + this.bannerName.offsetHeight + this.bannerDetails.offsetHeight;
|
||||
console.log('sum', this.sumBanner);
|
||||
|
Loading…
x
Reference in New Issue
Block a user