first commit
This commit is contained in:
32
templates/instytut_dendrologii_/js/blocoverflowydarzenia.js
Normal file
32
templates/instytut_dendrologii_/js/blocoverflowydarzenia.js
Normal file
@@ -0,0 +1,32 @@
|
||||
window.addEventListener('load', () => {
|
||||
blockarrow();
|
||||
})
|
||||
window.addEventListener('unload', () => {
|
||||
blockarrow();
|
||||
})
|
||||
function blockarrow(){
|
||||
|
||||
|
||||
var liczba=0;
|
||||
document.querySelector('.wydarzenia .owl-prev').style.setProperty('pointer-events','none');
|
||||
var iloscdivow=Math.round(new Number(document.querySelectorAll('.wydarzenia .owl-item').length/2-1));
|
||||
|
||||
document.querySelector('.wydarzenia .owl-prev ').addEventListener('click', () => {
|
||||
liczba--;
|
||||
|
||||
if(liczba < 1){
|
||||
document.querySelector('.wydarzenia .owl-prev').style.setProperty('pointer-events','none');
|
||||
}
|
||||
document.querySelector('.wydarzenia .owl-next').style.removeProperty('pointer-events');
|
||||
})
|
||||
document.querySelector('.wydarzenia .owl-next ').addEventListener('click', () => {
|
||||
liczba++;
|
||||
|
||||
if(liczba==iloscdivow){
|
||||
console.log('liczby sa rowne');
|
||||
document.querySelector('.wydarzenia .owl-next').style.setProperty('pointer-events','none');
|
||||
}
|
||||
document.querySelector('.wydarzenia .owl-prev').style.removeProperty('pointer-events');
|
||||
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user