Jump to content
Killersites Forums

Changing cursor to magnifier with Jquery


virtual
 Share

Recommended Posts

I am having difficulty getting the cursor to turn into a magnifier in both Mozilla and Webkit browsers. In the js file, I have this line

cursorcss: 'url(magnify.cur), -moz-zoom-in', //Value for CSS's 'cursor' attribute, added to original image

 

which works fine with Firefox, however if I do this, neither of them work.

cursorcss: 'url(magnify.cur), -webkit-zoom-in, -moz-zoom-in', //Value for CSS's 'cursor' attribute, added to original image

 

I can only get one or the other to work, not both at the same time.

 

I also tried adding this into the html file

 <script type="text/javascript">
$("img").css('cursor', function() {
            if (jQuery.browser.mozilla) {
               return '-moz-zoom-in';
           }
           else if (jQuery.browser.webkit) {
               return '-webkit-zoom-in';
           }
           else {
              return 'pointer'; 
           }
       });
</script>

but that did not work with either of the browsers.

 

Can anyone tell me what I'm doing wrong.

Link to comment
Share on other sites

Just guessing here but doesn't this require that the user have the zoom icon as part of their desktop settings in order for it to work?

 

Update...ok I see what you are doing. It does work but just not both. As Rosanna Anna Danna would say..."NEVERMIND!"

Edited by newseed
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...