Slide the slider on click event (Slick Slider)
<p>I am new in jquery. I am using a custom cursor and want to move the slider on click event now if the cursor is in left side of slider on click event it should slide on left side (to the previous slide) and if the cursor is in right side of slider on click it should slide on right side (to the next slide).</p>

<p>Currently it only moves in one direction i.e. in right direction.
here is my jquery code.</p>

<pre><code> $("#slider-arrow").mousemove(function(e){

    var z = $("#slider-arrow").width();
    var x = e.pageX - this.offsetLeft;

    if( x &gt;= z/2){

        $(this).css({ cursor : 'url(&lt;?php echo base_url('/assets/images/icon-next.png')?&gt;), auto'})

        .click(function () {

                    $("#slider-arrow").slick('slickNext');

            });
    }else if( x &lt;= z/2){

        $(this).css({ cursor : 'url(&lt;?php echo base_url('/assets/images/icon-open-prev.png')?&gt;), auto'})

        .click(function () {

                   $("#slider-arrow").slick('slickPrev');

        });
    }

});
</code></pre>