Reputation: 27
CSS:
.right_man
{
width: 50%;
height: 100%;
overflow: hidden;
}
JS:
jQuery(document).ready(function () {
$(this).mousemove(function (e) {
var page = $(document).width();
if (page / 2 > e.pageX) {
$('.right_man').width(page - e.pageX);
}else {
$('.right_man').width(page - (e.pageX - (page / 2)) - (page / 2));
}
});
});
Why code available only for Chrome ?
IE, Mozilla, Opera ignored hem.
I change changing $(this).mousemove to $(window).mousemove.
Fixt
Upvotes: 0
Views: 149
Reputation: 16764
Try use jquery css
jQuery(document).ready(function () {
$(this).mousemove(function (e) {
var page = $(document).width();
if (page / 2 > e.pageX) {
$('.right_man').css("width", page - e.pageX);
}else {
$('.right_man').css("width", page - (e.pageX - (page / 2)) - (page / 2));
}
});
});
Let me know if problem still persists.
Upvotes: 0