Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disabling zoom in and zoom out

    Hi i m using the below code to disable ctrl+ and ctrl- (zoom in/out using keyboard). The below code is working in firefox but it is not working in IE.

    The return false; is not working in IE. can you please some one help in this?

    $(document).ready(function()
    {
    var ctrlDown = false;
    var ctrlKey = 17, vKey = 189, cKey = 187;

    $(document).keydown(function(e)
    {

    if (e.keyCode == ctrlKey) ctrlDown = true;
    }).keyup(function(e)
    {
    if (e.keyCode == ctrlKey) ctrlDown = false;
    });

    $(document).keydown(function(e)
    {
    //alert(ctrlDown);

    if (ctrlDown && (e.keyCode == vKey || e.keyCode == cKey))
    return false;
    });
    });

    Please provide me do you have any other code to do this?

    Thanks,
    Jagadeesh.

  2. #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    IE won't let you do it. What would be the point anyway?

  3. #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply.

    Is there any other way to do it. Because I need to implement it for my websites. It will be very helpful if you tell any idea?

    Thanks,
    Jagadeesh.

  4. #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    It's a usability feature built into browsers, for a good reason: users should be able to increase (and decrease) the size of text and images to match their eyesight. If it's somehow breaking your site layout, then rather than seeking ways to disable this functionality - which, as has been pointed out, isn't going to work - you should be concentrating your efforts on building a site that accommodates various zoom settings.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •