This is a follow-up question to this SO question.
I have a new requirement where I need to add an input field to the top of the panel.
So I would like $.scrollTo to affect #myContent instead of #myPanel .ui-panel-inner.
Here's the fiddle. You can see that the input field scrolls off the screen.
I thought I would try adding a div around the content:
$(document).on("pagebeforeshow", "#page1", function(){
$('#myPanel').on('panelopen',PanelOpen);
});
function PanelOpen(myEvent, myUI ) {
$("#myContent").scrollTo('#ID498',1000)
}
But it doesn't work.
Update your CSS so that the content is scrollable instead of the inner panel. The inner panel is still sized to fit the screen and then myContent is sized to fill the inner panel but leaving room at the top for the new input element:
.ui-panel .ui-panel-inner {
overflow: hidden;
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
}
#myContent {
overflow: auto;
position: absolute;
top: 78px; left: 0; right: 0; bottom: 0;
-webkit-overflow-scrolling: touch;
}
Then in panel open:
$("#myContent").scrollTo('#ID498',1000);
Updated FIDDLE
Another way of doing it with css
#myHeader { position: fixed;
z-index: 9999;
background-color:white;
box-shadow: 0px 0px 0px 28px white;
}
#myContent { margin-top:35%; }
Because of the Margin above with this method you subtract 5 on your ID's to get the position below the search box
#ID493 will go to 498
Demo http://jsfiddle.net/8dJJb/
Related
How to theme the scrollbar in xtermjs? I see the theme options for the background and foreground but nothing related to the scrollbar.
If anyone is looking, this was my solution in the xterm.css addind --webkit onto the viewport selector
.xterm .xterm-viewport {
/* On OS X this is required in order for the scroll bar to appear fully opaque */
background-color: transparent;
overflow-y: scroll;
cursor: default;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
scrollbar-color: var(--highlight) var(--dark);
scrollbar-width: thin;
}
.xterm-viewport::-webkit-scrollbar {
background-color: var(--dark);
width: 5px;
}
.xterm-viewport::-webkit-scrollbar-thumb {
background: var(--highlight);
}
I have drawer animated mobile menu with scrollable navigation and fixed footer.
Since fixed element inside transformed element is impossible according to an old issue I applied absolute position to the footer and apply scroll to the navigation container.
The problem is that on IOS 12.1 footer randomly disappears.
HTML
<div class="menu">
<nav class="nav">...</nav>
<footer class="footer">Some footer</footer>
</div>
CSS
.menu {
position: fixed;
z-index: 1050;
top: 0;
left: 0;
overflow-x: hidden;
overflow-y: auto;
width: 100%;
min-height: 100%;
transition: transform .3s ease-out;
transform: translate(-100%, 0);
-webkit-overflow-scrolling: touch;
&.menu-open {
transform: translate(0, 0);
}
}
nav {
position: absolute;
left: 0;
top: 0;
width: 300px;
height: 100%;
overflow: auto;
}
footer {
position: absolute;
bottom: 0;
width: 300px;
height: 65px;
}
UPD
I knew two working fixes:
1. change transform animation property to left, but thats less performant
2. set nav bottom to 65px to not overlap with footer but that's not answers why it's happening
Fiddle
If a jQuery UI draggable element (#box1) is dragged over an element (#box2) that has z-index set to -1 or below, mouseover and mouseout events won't fire. With z-index set to 0 or above they fire.
CSS:
#box1 {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
border: 1px solid blue;
}
#box2 {
position: absolute;
top: 100px;
left: 300px;
width: 100px;
height: 100px;
border: 1px solid red;
z-index: -1;
}
JavaScript:
$(function() {
$("#box1").draggable();
$("#box2").mouseover(function(e) {
$("#box2").css({
backgroundColor: "green"
});
});
$("#box2").mouseout(function(e) {
$("#box2").css({
backgroundColor: "transparent"
});
});
});
See: http://jsfiddle.net/TTwPj/11/
Without dragging mouseover and mouseout work fine with all z-index-values.
Is there a reason for this behaviour or is it a bug?
This "problem" has nothing todo with negative or positiv values of your z-index.
In this updated fiddle: http://jsfiddle.net/TTwPj/23/
#box1 {
z-index: 2;
}
#box2 {
z-index: 1;
}
you can see I set some positive values and the mousover still not firing. This is how z-index work.
If you want to achive a mouseover while dragging over the droppable element you can use the droppable event:
over: function( event, ui ) {}
to add a CSS class or style to show some visible "mouseover" effect.
Hi
i am using theme="a", data-overlay-theme="a" and data-dismissible="false". But it is not working on whole page of iPad. How to apply on whole screen so that it look fine.
I also used this:
$(document).on('popupafteropen', '[data-role="popup"]', function(event, ui) {
$('body').css('overflow', 'hidden');
}).on('popupafterclose', '[data-role="popup"]', function(event, ui) {
$('body').css('overflow', 'auto');
});
Here is my code.
jquery css
.ui-popup-screen {
background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); /* Necessary to set some form of background to ensure element is clickable in IE6/7. While legacy IE won't understand the data-URI'd image, it ensures no additional requests occur in all other browsers with little overhead. */
top: 0;
left: 0;
right: 0;
bottom: 1px;
position: absolute;
filter: Alpha(Opacity=0);
opacity: 0;
z-index: 1099;
}
.ui-popup-screen.in {
opacity: 0.5;
filter: Alpha(Opacity=50);
}
.ui-popup-screen.out {
opacity: 0;
filter: Alpha(Opacity=0);
}
Structure Css**************************
.ui-popup-screen {
background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); /* Necessary to set some form of background to ensure element is clickable in IE6/7. While legacy IE won't understand the data-URI'd image, it ensures no additional requests occur in all other browsers with little overhead. */
top: 0;
left: 0;
right: 0;
bottom: 1px;
position: absolute;
filter: Alpha(Opacity=0);
opacity: 0;
z-index: 1099;
}
.ui-popup-screen.in {
opacity: 0.5;
filter: Alpha(Opacity=50);
}
.ui-popup-screen.out {
opacity: 0;
filter: Alpha(Opacity=0);
}
This should help, overlay DIV should now cover whole page, doesn't matter how much screen size is big or is content scrolled or not.
CSS:
.ui-popup-screen {
position: absolute !important;
top: 0 !important;
right: 0 !important;
bottom: 0 !important;
left:0 !important;
}
This CSS block has been tested in jsFiddle example so I can be 100% sure it will work. If not We will find another solution.
I am rendering a jQuery combobox, but the height of input element does not match the height of toggle button as shown in screen shot below. This is happening in both, IE 9 and FireFox 13.
The style being used for jQuery combobox is as below.
<style>
.ui-combobox {
position: relative;
display: inline-block;
}
.ui-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* adjust styles for IE 6/7 */
*height: 1.7em;
*top: 0.1em;
}
.ui-combobox-input {
margin: 0;
padding: 0.3em;
}
.ui-autocomplete { height: 200px; overflow-y: auto; }
</style>
You should update your combo-box widget from the jqueryui page. and make sure that you use the latest jquery-ui (this issue was fixed recently).
this helped me...