Here is my code
$(document).ready(function(){
$(window).resize(function() {
if ($(window).width() > 980) {
$('.info-container a').toggle(function() {
$(this)
.closest('li')
.find('.work-info')
.fadeIn();
return false;
}, function() {
$(this)
.closest('li')
.find('.work-info')
.fadeOut();
return false;
});
}
else {
$('.info-container a').unbind('click');
}
});
});
I want show the hidden div on click, when browser width > 980px.
when I open page - code does not work as long as the width of the window will not change. After that, it works fine.
Here is my code in JSFIDDLE but it doesn't work there...