jquery - window.width() doesn't work properly on lower screen resolution -
i want run function if right side of div clicked, , function if left side clicked (div horizontally centered inside html).
$("#div01").click(function (e) { if (e.pagex > $(window).width() / 2)(changeup()) else(changedown()); }); works on screen resolution 1024x768 , higher (without horizontal scroll bar on screen), doesn't work on lower (800x600) resolution, when horizontal scroll appears. in case need click more left run changedown().
any help, pls;
try this:
$("#div01").click(function(e) { if (e.pagex > $(window).width() / 2) { changeup(); } else { changedown(); } });
Comments
Post a Comment