$('.photo').click(function(){
$('.photo').removeClass('active-element');
$(this).addClass('active-element');
$('.point li').removeClass('active-point').
filter((index, item) => $(this).data('id') == $(item).data('id')).addClass('active-point');
$('.about-text p').text($(this).data('text'));
$('.about-site p').text($(this).data('info'));
$('.about-site a').text($(this).data('website')).attr("href", "#");
});
$('.point li').click(function(){
$('.point li').removeClass('active-point');
$(this).addClass('active-point');
});
function handleClick() {
$('.photo').removeClass('active-element');
$(this).addClass('active-element');
$('.point li').removeClass('active-point').
filter((index, item) => $(this).data('id') == $(item).data('id')).addClass('active-point');
$('.about-text p').text($(this).data('text'));
$('.about-site p').text($(this).data('info'));
$('.about-site a').text($(this).data('website')).attr("href", "#");
}
$('.photo').click(handleClick);
$('.point li').click(function() {
$('.point li').removeClass('active-point');
$(this).addClass('active-point');
handleClick.call(this)
});
function handleClickOnPhoto($photo){
$('.photo').removeClass('active-element');
$photo.addClass('active-element');
$('.point li').removeClass('active-point').
filter((index, item) => $photo.data('id') == $(item).data('id')).addClass('active-point');
$('.about-text p').text($photo.data('text'));
$('.about-site p').text($photo.data('info'));
$('.about-site a').text($photo.data('website')).attr("href", "#");
}
$('.photo').click(function(){
handleClickOnPhoto($(this));
});
$('.point li').click(function(){
$('.point li').removeClass('active-point');
$(this).addClass('active-point');
handleClickOnPhoto($(this));
});