Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9032163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:54:43+00:00 2026-06-16T07:54:43+00:00

While at IE this works in chrome it wont: Snap Option in draggable stop

  • 0

While at IE this works in chrome it wont: “Snap” Option in draggable stop working while pressing “Ctrl”, i cant even seem to get the alert(“SNAP”) when pressing ctrl while dragging. my tries are:

 $("#object").draggable({
        handle: '#handle_',
        containment: '#MainBody',
        snap: ".drag_alignLines", // Setting snap to alignment lines
        snapTolerance: 15
                            }).bind('keydown', function(event){ 
                        alert("SNAP");
                    if(event.ctrlKey)
                    {
                        alert("hi");
                        this.draggable( "option", "snap", false );
                    }
                });

cant get Chrome to catch the ctrl key while dragging…
and even in IE the: “this.draggable( “option”, “snap”, false );” just dont make it stop snap while dragging…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:54:44+00:00Added an answer on June 16, 2026 at 7:54 am

    What you want to do is reset the snap option like so:

    $( "#object" ).draggable( "option", "snap", false );
    

    And remember to set it back to the original value on a regular click. Here is the relevant section of this jsfiddle:

    $("#object").draggable({
    containment: '#MainBody',
    snapTolerance: 15,
    start: function(event)
        {
            if(event.ctrlKey)
            {
                $(this).draggable("option", "snap", false);
            }else {
                $(this).draggable("option", "snap", '.drag_alignLines');
            }
    
        }});
    

    It binds to ‘start’ rather than on ‘keydown’ so you don’t have to aim before hitting Control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a problem where firefox works just fine, while chrome has the problem.
If a is undefined, this works: if(window.a) {} while this throws an error: if(a)
I have the following code: Bear in mind that while this code works on
Why does this work well: cout << foo; While this doesn't? (&cout)->operator<<(foo); It works
I'm searching a while for this and I can't found something that works for
I have PHP script works without problems, like this : while($row4 = mysql_fetch_array($result4)) {
This foreach loop works fine while testing and only returning 5 rows of data,
I have seen this answer https://stackoverflow.com/a/9243472/563381 And while it works well visual as soon
I don't undestand why this script doesn't work in IE, while it works in
This works in FF and in Chrome but the click has no action in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.