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

howto position? #10

Open
ghost opened this issue Jan 24, 2016 · 4 comments
Open

howto position? #10

ghost opened this issue Jan 24, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2016

the position of the popups seems "hardwired" into the css and on long pages the popup may easily end up "out of sight".

What would I do to ensure the popup is always displayed in the visible part of the page or near the mouse click? Can't seem to find the api to pass the position.

@kylepaulsen
Copy link
Owner

This is the easy fix as seen in the readme:

.nanoModal.nanoModalOverride {
    position: fixed;
}

If you want it to be extra custom, you'll have to use js to position it yourself.

@ghost
Copy link
Author

ghost commented Jan 25, 2016

doing it in JavaScript seem better in my case anyway. Do I need to take special care where exactly to the document I attach the css?

@kylepaulsen
Copy link
Owner

You probably don't need to do anything more special than something like (when using jquery):

// if you want it near the mouse click
$(".nanoModal").css({
    top: mouseY + someOffset,
    left: mouseX + someOtherOffset
});

But this is just a guess.

@ghost
Copy link
Author

ghost commented Jan 25, 2016

No jquery here, I am experimenting in the context of a PageMod script of a Firefox extension where I want very little external dependencies.

At the same time I am slightly nervous as it will is displayed over a webpage which is not under my control - my javascript is fully sandboxed but in theory the webpage could attempt to sabotage me by defining conflicting CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant