I want to lock scroll when modal is open. I add to body overflow: hidden, but that doesn't help.
I also install js lib scroll-lock that do almost same thing.
Here is a shot of that magic https://imgur.com/5bd7K55
How to lock scroll?
Fixed it by adding by additinal height: 100vh
Related
my problem is that I have a lot of AbsolutePanels in GWT an they are drawn as if they were a TabLayoutPanel ( the GUI looks like a TabLayoutPanel, however, it is not one, it is made of a lot of AbsolutePanels ).
So, now I have the problem that as soon as a lot of tabs are opened they exceed the max. width of the AbsolutePanel and so they cannot be seen anymore nor can they be clicked or anything else.
So, is it somehow possible to add a ScrollBar to this AbsolutePanel in order to scroll back and forth?
I do not think it is a good idea to post any code because everything is being done programmatically. The only thing that I would need is an example of how to accomplish a scrollbar within an AbsolutePanel. This AbsolutePanel is of a fixed width!
Thank you very much for your help in advance.
Use CSS Overflow property.
You just need to set overflow: auto;.
It can be done programmatically:
panel.getElement().getStyle().setOverflow(Overflow.AUTO);
or with CSS style sheet:
.overflowAuto {
overflow: auto;
}
and
panel.addStyleName("overflowAuto");
I was not able to find how to change the position for top for the latest reveal modal in foundation 5. Seems I have to make a change in the *.js file, but where?
If you are encountering the issue that the top position of the modal is not matching your needs, try to add the following to your css.
.reveal-modal-bg {
position: fixed;
}
.reveal-modal {
top: 150px !important;
}
This will make shure that your modal and your modal background are always on top - and not somewhere off the viewport.
The thing is that - as I think, reveal positions it self under the position you have clicked with the mouse. So if you open the modal with a click on a link at the bottom of your page, it opens Npx under the point you have clicked. This caused my modal to cinda vanish of the viewport. But I have fixed it with the css code I posted above.
Hope It helps you.
Now to your original Question. If you want to change the Javascript of the reveal modal, you will have to include the single js files of foundation - what means not the foundation/js/foundation.min.js but the single files you need in your project - eg. foundation/js/foundation/foundation.js and foundation/js/foundation/foundation.reveal.js. Then you can make your changes in the foundation/js/foundation/foundation.reveal.js file. I think you are looking for the show method, which starts at Line 300.
Hope this helps, good luck! :)
You can change the Sass variable:
$reveal-position-top: rem-calc(100);
The default is 100 (modal opens 100px from top of screen).
I am using a AutoCompleteTextField from Wicket inside of a modal window. The problem is I have it near the bottom of the window, along with a dropdownChoice.
When I select the dropDownChoice, and if it is near the top, the drop down choice will drop down as normal, but if it is near the bottom of the window it will go up. For the AutoCompleteTextField if it's at the bottom, it will still drop down, and the modal window will become scrollable to view the choice. I do not want this, how can I prevent this?
Still haven't found an answer to this, but for anyone who runs into this issue, the only simple solution I found to solve this is just to set a size limit on the div, and make it scrollable, like so:
div.wicket-aa ul { list-style:none; padding: 2px; margin:0; max-height:55px; overflow-y: auto; }
I need to have some help with an annoying thing.
I have an modal popup which has vertical scrollsbar inside. When scrolling inside the modal sometimes the background scrolls instead.
I have tried to add
body{
position:relative;
overflow: hidden;
}
which works fine on most of the browsers, but Safari for my iPhone still scrolls!
Please help me find how to solve this!
Regards Kristian
$('body').css('overflow','hidden');
$('body').css('position','fixed');
Did it for me.
I am using phonegap.
I want to keep a fixed header and footer,and i want to scroll the content in between them. For that i used div with:
div
{
width: 249px;
height: 299px;
background-color:Gray;
overflow-y: auto;
}
style.
But the div is not scrolling.
But in browser it is fine.
iOS doesn't allow scrolling within an element (div with overflow:scroll/auto or frames) so you can either design your site around that (usually for the best) or you can try iScroll, which is a javascript plugin designed to re-instate this ability:
http://cubiq.org/iscroll-4
Good luck.
Div scrolling does work in iOS if this property is added:
-webkit-overflow-scrolling: touch