Witam, ma pytanie napisałem skrypt i nie działa mi to poprawnie problem polega na tym że nie robi mi resize w funkcji .onclick i nie wiem jak zrobić zeby tam też resize działał, zawsze jak robie resize to odwołuje mi się do zmiennej first_height i bierze wysokość boxu o klasie .projektowanie. A mam tam pobieranie wysokości i nadawanie jej przy załadowaniu strony ponieważ ona ma style absolute.
Jak nadpisać tą zmienna projektowanie przy clicku?
$( document ).ready(function() {
ofertaShowItem();
});
$( window ).resize(function() {
ofertaShowItem();
});
function ofertaShowItem() {
var first_height = $('.projektowanie').height();
$('.right_content').css('height', first_height);
$( ".uslugi_item" ).click(function() {
var data_choice = $( this ).data().choice;
$('.uslugi_item').removeClass("active");
$(this).addClass("active");
$('.uslugi_description').each(function() {
var data_index = $( this ).data().index;
if(data_choice == data_index ){
first_height = $(this).height();
$('div[data-index = '+data_index+']').fadeIn();
$('.right_content').css('height', first_height);
}
else{
$('div[data-index = '+data_index+']').fadeOut();
}
})
});
}