Setting the mouse cursor in client-side

Easy using jQuery. It defines a function called css().

This example demonstrates that you can use JavaScript only as well. But in IE, it won’t work, so we use jQuery.


<a id="lnkFabio" href="http://fabiocanada.ca">Fabio's blog</a>

<script type="text/javascript">

        if ($.browser.msie) //use jQuery css function for IE
                $('#lnkFabio').css('cursor', 'pointer');
        else
                document.getElementById('lnkFabio').setAttribute('style', 'cursor:pointer;');
</script>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s