Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positioning of keyboard based on pixels? #388

Closed
bcmans opened this issue Aug 28, 2015 · 3 comments
Closed

Positioning of keyboard based on pixels? #388

bcmans opened this issue Aug 28, 2015 · 3 comments

Comments

@bcmans
Copy link

bcmans commented Aug 28, 2015

would it be possible to do this just based on actual pixels let say 500px from the top and 200px from the left border of the screen?

I cant find how to do this other than

$('#keyboard').keyboard({

    // see http://jqueryui.com/demos/position/ for details on how to use this
    position: {
        of: $(window), // null = attach to input/textarea; use $(sel) to attach elsewhere
        my: 'center center',
        at: 'center center',
        at2: 'center center' // used when "usePreview" is false
    }

});

thanks
bc

@Mottie
Copy link
Owner

Mottie commented Aug 28, 2015

Hi @bcbacon!

The way the jQuery UI position utility works is that you add the adjustments in with the settings (demo):

$('#keyboard').keyboard({

    // see http://jqueryui.com/demos/position/ for details on how to use this
    position: {
        of: $(window),
        my: 'left top',         // point on keyboard element
        at: 'left+200 top+500', // point in "of" element
        at2: 'center center'    // used when "usePreview" is false
    }

});

I guess I should have included that in the docs, but I figured the jQuery UI position utility docs had that covered.

But really, if you are going to always position the keyboard in the same place, you really don't need jQuery UI's position utility. You can just use css (demo):

.ui-keyboard {
  left: 200px;
  top: 500px;
}

In both demos, I set the top to 50px otherwise it makes you think the keyboard isn't positioning in the correct place... way below the input.

@bcmans
Copy link
Author

bcmans commented Aug 28, 2015

thank you so much this helps big time!

@Mottie
Copy link
Owner

Mottie commented Nov 15, 2015

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.

@Mottie Mottie closed this as completed Nov 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants