在输入框内触发移动到特点区域事件(也可换成点击事件)

移动时的事件mousemove是重点,换成mouseover是不行的。点击事件无问题。目前我用于在输入框的结尾处使鼠标变为手型,另外加click事件来触发写的控件。这样就不用再输入框中另外加元素来触发。

 $("input.frequency").bind('mousemove',function(e){
            var left = $(this).offset().left;
            var width = $(this).width();
            var mouseX = e.pageX;
            if(mouseX - left > width -16 ){
                $(this).css('cursor','pointer');
            }else {
                $(this).css('cursor','text');
            }
        });
posted @ 2016-11-29 14:31  稍微有点色  阅读(126)  评论(0编辑  收藏  举报