I'm trying to capture the window size in certain case and depend of the width I apply a different left position using this code :
case 'above':
modal.css({
'top': buttonPosition.top - modal.outerHeight() + scrollTop,
'left': $(window).resize(function() {
var i = $(this).width();
if (i > 735) { buttonPosition.left - 188;}
else {
buttonPosition.left - 100;
}
})
});
break;
but this don't seem to apply any thing whatever the width of the window the element still in the same position , but when i remove the $(window).resize(function()
it works like so :
case 'above':
modal.css({
'top': buttonPosition.top - modal.outerHeight() + scrollTop,
'left': buttonPosition.left - 188;
});
break;
but this is don't allow me to change the left position depend on the window size , any help would be greatly appreciated