I have a div element that is 980px wide and I'd like to be able to trigger an event if the mouse is in the last 100 pixels or so of the div (I want to slide it). I already know how to slide it, but I haven't been able to make something that tells me when the mouse is either in the first 100pixels so it scrolls left or after the 880 so it can go right. This is my markup:
<div class="menuProductosNav">
<ul>
<li><a href="computadoras.html"><img src="assets/img/menuProductos/producto0.png" alt="" /></a></li>
<li><a href="consumibles.html"><img src="assets/img/menuProductos/producto11.png" alt="" /></a></li>
<li><a href="impresoras.html"><img src="assets/img/menuProductos/producto2.png" alt="" /></a></li>
<li><a href="apple.html"><img src="assets/img/menuProductos/producto1.png" alt="" /></a></li>
<li><a href="productos.html"><img src="assets/img/menuProductos/producto3.png" alt="" /></a></li>
<li><a href="redescomu.html"><img src="assets/img/menuProductos/producto4.png" alt="" /></a></li>
<li><a href="proyecciones.html"><img src="assets/img/menuProductos/producto5.png" alt="" /></a></li>
<li><a href="accesorios.html"><img src="assets/img/menuProductos/producto6.png" alt="" /></a></li>
<li><a href="energia.html"><img src="assets/img/menuProductos/producto7.png" alt="" /></a></li>
<li><a href="refacciones.html"><img src="assets/img/menuProductos/producto8.png" alt="" /></a></li>
<li><a href="software.html"><img src="assets/img/menuProductos/producto9.png" alt="" /></a></li>
<li><a href="pdv.html"><img src="assets/img/menuProductos/producto10.png" alt="" /></a></li>
</ul>
</div>
I honestly am lost at this, could anyone let me know how to do this? all I can get is the element's width:
var $nav = $('.menuProductosNav');
$nav.bind('mouseover',function(){
alert($nav.width());
});