I have a page, and when you scroll it, objects (container ...) become visible. I also have projects. So when you click on one of them, my page scrolls up. And I want to disable this feature that I mentioned earlier (showing to disable scrolling!).
$(document).ready(function(){
var offsetActivity = (1);
var wScroll = ($(window).scrollTop());
var wHeight = ($(window).innerHeight());
var thirdHeight = (wHeight/1.3);
$('.secondic > .row > a > .one-half > p').click(function(offsetActivity){
var offsetActivity = (0);
var projBack = $(this).parent().css('background-image');
var parent = $(this).parent().attr('id');
var textAbout = $('#'+ parent +' > p.about-photo').text();
$('header').css('background-image', ''+ projBack +'');
$('header > .headerCont > h5').replaceWith('<h5>'+ textAbout +'</h5>');
setTimeout(function(){
$('.container').removeClass('offset-done');
$('.container').children().removeClass('offset-done');
}, 2000);
});
if(offsetActivity = (1)){
$(window).scroll(
function(){
var wScroll = ($(window).scrollTop());
var wHeight = ($(window).innerHeight());
var thirdHeight = (wHeight/1.3);
console.log(wHeight, wScroll, thirdHeight);
if(wScroll > (($('.container').offset().top)-thirdHeight)){
$('.container').addClass('offset-done');
}
if(wScroll > (($('.window').offset().top)-thirdHeight)){
$('.window').addClass('offset-done');
}
});
});
so how to disable this function when i click on my P? I also want to not be able to turn it on after the project is completed
source
share