-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Center pop-up in window #41
Comments
Hi, thanks Actually it should be opened in the center of the page, could you share a demo with a bug? |
Hey Eric, Ive been toying with it on http://www.wunder.co/index1.html It looks like the popup is appearing y=-150px. Not sure how to bring this down. Thanks!! |
I'm experiencing it as well. If you scroll down a bit long, then the popup seem to be hidden from the page. Change the position to fixed doesn't work neither. I guess this is a bug with browser when scale is applied? |
Look like scale is the cause. I remove all scale declaration from CSS and the dialog is aligned perfectly centered on the page. |
Hey! Thanks for writing back. Quick question, if I killl the scale in It works great. Except, the background no longer scales out. Any ideas? Lauren Wunderlich On Sat, Sep 21, 2013 at 3:59 AM, Phuong Nguyen notifications@github.heygears.comwrote:
|
Scale is the heart of the effect. As you remove the scale, the effect is removed. My guess of a solution is that you can put the whole document in a single container did (instead of the body tag) and scale that did instead. Put the popin out of that scaled div so that it can be positioned properly. |
Ok thanks! Will give it a try :) Lauren Wunderlich
|
@wunderco @phuongnd08 I'm trying to fix this now, this scale stuff is a bit tricky and @phuongnd08's proposal is considered to be a solution but for now I don't think it's the best variant to wrap user's content with one more container (if no better solution will be found I think it can be optionate then). |
@wunderco @phuongnd08 also I'm thinking about scrolling user up to the top of page.. what do you think? |
Ahh yea, but mine is off and above the view. Plus the rest if the site ends up scrolling you up. I still don't understand why it works sans issues on the demo? Is it wrapped up in a container as mentioned? Lauren Wunderlich
|
@wunderco demo doesn't contain long content on it, you can checkout how positioning of child inside scaled container behaves here - http://labs.voronianski.com/test/scaled-positioning.html |
Do we have a fix or a workaround for this ? I just cant use the popup if my trigger is down the page, because the popup is positioned on top... Please let me know. Thanks. |
Workaround - Can you calculate the pixels from the top (pixels scrolled down) in the onLoad function and set the popup's height accordingly ??? |
Hey Jake, Thanks! Lauren Wunderlich On Fri, Nov 1, 2013 at 12:47 PM, Jake notifications@github.com wrote:
|
I have the same issue. Got this all setup, and now if I use a trigger low on a long page, the pop-in is way up where the user cannot see it. Please advise |
The popup should be fixed to the browser window, not to the page, but I tried playing with the CSS to do this, and was not successful. |
I managed to fix this issue by playing with body's scrollTop. Here's what I changed at line 93 in jquery.avgrund.js : // Fix for window scroll
var s = $('body').scrollTop();
$('.avgrund-popin').css({
'width': maxWidth + 'px',
'height': maxHeight + 'px',
'margin-left': '-' + (maxWidth / 2 + 10) + 'px',
'margin-top': '-' + (maxHeight / 2 + 10 - s) + 'px'
}); |
Hi I think this problem can be fixed by bringing the modal outside the transformed content. I forked it and tweaked the code a bit, you can see my feature branch here, and a quick demo here. The code is still to be checked and refactored but I guess this is a good way to make it work. |
Why don't just open a pull request then you can get some review. |
👍 @nobitagit yes please, submit a pull request. Demo looks pretty fine so PR to review is needed ;) |
Fair enough, PR submitted. |
Any progress on this pull ? this problem still there and is quite annoying. |
I fixed it with this code: // Fix for window scroll
var s = $('body').scrollTop();
if(s > (maxHeight / 2 + 10)){
$('.avgrund-popin').css({
'width': maxWidth + 'px',
'height': maxHeight + 'px',
'margin-left': '-' + (maxWidth / 2 + 10) + 'px',
'margin-top': (maxHeight / 2 + 10 + (s-maxHeight)) + 'px'
});
}else{
$('.avgrund-popin').css({
'width': maxWidth + 'px',
'height': maxHeight + 'px',
'margin-left': '-' + (maxWidth / 2 + 10) + 'px',
'margin-top': '-' + (maxHeight / 2 + 10 - s) + 'px'
});
} |
im not edit jquery.avgrund.js. i only use onload function to get to top ^^ $('html,body').animate({scrollTop: '0px'}, 500); //EDITED USING JQUERY |
I just started using Avgrund for a project, and it's working really well.
I have an <iframe> containing a video from youtube popping up, and it seems to be working well so far. However, the pop-up is opening at the top of the page, instead of in the center. Is there any easy fix for this?
The text was updated successfully, but these errors were encountered: