<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(this).mousemove(function(e) {
$('.style1').width(e.pageX);
});
});
</script>
</head>
<body>
<div style="background-color: red;" class="style1">test</div>
</body>
</html>