I am currently facing an issue where the viewport width is not being displayed on page load. Does anyone know what might be causing this problem and how it can be resolved?
function onViewWidthChange() {
var viewWidth = $(window).width();
console.log(viewWidth);
if (viewWidth > 776) {
$("area[data-toggle]").click(function(e) {
e.preventDefault(); // prevent navigating
var selector = $(this).data("toggle"); // get corresponding element
$(".detail-box").hide();
$(".detail-box"+selector).show().addClass('animated fadeIn');
});
}
}
$(window).on('load, resize', onViewWidthChange);