I have a page, and when you scroll that, objects (container...) become visible. Also I have projects. So when you click on one of them, my page scrolls up. And i want to disable that function that I told before (showing up, not to disable scroll!).
$(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 that function when i click on my P? Also i want ot be able to turn it on again after i close the project