s24344,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#back-top{
position: fixed; top: 0; left: 0;
display: block;
width: 82px;
background: #FF7055;
opacity: 0.5;
cursor: pointer;
height: 0;
transition: all .8s ease-in-out;
}
#back-top.target{
background-color: #00FF00; height: 100px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
$(document).mousemove(function(b) {
var c = $("#back-top"),
a = c.offset(),
a = {
top: a.top - 300,
left: a.left - 300,
right: a.left + c.width() + 300,
bottom: a.top + c.height() + 300
};
c.toggleClass("target", b.pageX <= a.right && b.pageX >= a.left && b.pageY <= a.bottom && b.pageY >= a.top)
})
});
</script>
</head>
<body>
<div id="back-top"></div>
</body>
</html>