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

How to put the keyboard at the bottom of the browser from an iFrame #230

Closed
chatis opened this issue Feb 4, 2014 · 16 comments
Closed

How to put the keyboard at the bottom of the browser from an iFrame #230

chatis opened this issue Feb 4, 2014 · 16 comments

Comments

@chatis
Copy link

chatis commented Feb 4, 2014

How to put the keyboard at the bottom of the browser from an iFrame ? I tried position of with : parent.$(window) but not working.. Is there a way ?

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2014

Hi @chatis!

If the iframe is in the the same domain as the page, then it should be possible. If not, then the answer is no.

To access the parent page from an iframe, use parent.document, like this:

$(parent.document).find('body')

But I'm not sure if that would work with this keyboard, because I've never tested it. If you could set up a demo, I'll see if I can help troubleshoot any problems that pop up.

@chatis
Copy link
Author

chatis commented Feb 4, 2014

Hello,

This is not working... I have almost fine something with $('input:password, input:text', iframe.contents()) but this is not working well... I also have some problem to give you a demo, bevause it's impossible to put an iframe with script inside on http://jsfiddle.net/Em8sG/2486/ ...

But what I want It's always have the keyboard at the bottom of the browser when I open with the window or in a iFrame..

Thank you

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2014

You can nest a fiddle within a fiddle... just take the url and add show/ (demo)

<iframe height="300px" width="300px" src="http://fiddle.jshell.net/Em8sG/2486/show/"></iframe>

@chatis
Copy link
Author

chatis commented Feb 4, 2014

This is perfect for a demo !!! The keyboard on the iframe is at the bottom of the iframe. I would like at the bottom of the parent window (where is the other outside the iframe)... Is it possible ?

@Mottie
Copy link
Owner

Mottie commented Feb 5, 2014

Well, let me ask you this... can the parent window load in the css for the keyboard? Would it be possible to just have the css, script and everything in the parent and then attach to an input within the iframe? This would make things a whole lot easier.

@Mottie
Copy link
Owner

Mottie commented Feb 5, 2014

Here you go (demo)

// make sure the iframe has completed loading
// before initializing the plugin
$("iframe").on("load", function () {
    $(this).contents().find("input").keyboard();
});

@chatis
Copy link
Author

chatis commented Feb 5, 2014

Hey, I done something like you.. but it's not working well when there is more than one input.. http://jsfiddle.net/Em8sG/2494/

Try to click with your mouse on the first, click on the second and back to the first... The keyboard isn't showing again.... Thank you for your help

@Mottie
Copy link
Owner

Mottie commented Feb 5, 2014

Try setting the stayOpen option to true (demo)

@chatis
Copy link
Author

chatis commented Feb 5, 2014

Thank you, but in My case, i don't want To let open... it won't works.. is there an other way? Thank you

@Mottie
Copy link
Owner

Mottie commented Feb 5, 2014

That option only keeps the keyboard open if the input loses focus, you can always press escape to close the keyboard.

@chatis
Copy link
Author

chatis commented Feb 5, 2014

OK i ll try.. but the iframe is a shadowbox that could be open or Not.. so i need that close When the shadowbox is close.. i ll Hey :-)

--- Message initial ---

De : "Rob G" [email protected]
Envoyé : 5 février 2014 13:49
A : "Mottie/Keyboard" [email protected]
Cc: "chatis" [email protected]
Objet : Re: [Keyboard] How to put the keyboard at the bottom of the browser from an iFrame (#230)

That option only keeps the keyboard open if the input loses focus, you can always press escape to close the keyboard.


Reply to this email directly or view it on GitHub:
#230 (comment)

@Mottie
Copy link
Owner

Mottie commented Mar 6, 2014

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 this discussion.

@Mottie Mottie closed this as completed Mar 6, 2014
@ghost
Copy link

ghost commented Mar 18, 2014

Hi Motie, I'm trying to achieve the same effect, the keyboard stretched all the way on the bottom when the input gets focused and remain open until I click anywhere that is not an input (loose focus).

The problem with the same above is that when I switch from one input to another the keyboard doesn't refresh thus still editing the input that was first clicked.

Any help you can provide will be great,
Thanks

@ghost
Copy link

ghost commented Mar 18, 2014

Btw, I'm not using any iframe, it's just a simple page.

@Mottie
Copy link
Owner

Mottie commented Mar 18, 2014

Hi @paul-c-f!

Could you please modify this demo with the code you are using, and hopefully it displays the same issues you are describing. It would really help me troubleshoot this problem.

@ghost
Copy link

ghost commented Mar 18, 2014

Hi Mottie, I wasn't able to reproduce it as well so I might need to clean up my code to find out what I have broken, if I happen to find it I will post it here, basically the preview doesn't get updated with the current field's value when you cycle among the inputs.

My modification: http://jsfiddle.net/MK947/1997/
Thank you

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