Customize Scrolling for Onsen Page (Pull to refresh) - ios

I have a ons-page element that I want to customize the scrolling for. There are a few things I'd like to achieve, but mostly I want to understand what's going on.
By default, the page has -webkit-overflow-scrolling: touch. This is undesirable for two reasons:
The area "behind" the page shown during overflow is just plain white
I have no hooks to take action on over scroll. I'd like to add pull to refresh mechanics.
I've tried working with iScroll, but the behavior I'm seeing is that if I declare my scrollable element to be inside of the page, it calculates the full element height as the visible height. If I declare my scrollable element to be the page, I can move the page around, but not the content within the page.
I'm guessing some of this is related to "using native scrolling where it can", but I don't really understand how that's implemented, so I'm not really sure.
Any ideas?

Onsen UI doesn't support pull-to refresh as default.
How about using this library?
https://github.com/mgcrea/angular-pull-to-refresh
This is a library for angularJS.
P.S
Now Onsen UI support pull-to-refresh. http://onsen.io/reference/ons-pull-hook.html

Related

Hide sidebar fully in ant design

Is there anyway to hide ant design sidebar fully on onCollapse method?
One way is to set it's display to none, But I don't want that coz I want the same animation that onCollapse method provides by default.
As mentioned in the "Responsive" example you can set <Layout.Sider collapsedWidth={0} />, which will completely hide it.
By default this causes a trigger button with a hamburger icon to appear, but you can turn it off by adding trigger={null}.
Antd uses breakpoints similar to bootstrap, their idea is Mobile first, which means, you should think in mobile first.
It means, you should not design your web app for desktop and then try to hide/adjust when it's in smaller view.
Instead, you should, design it for mobile view and then adjust to desktop view.
ultimately, what I want to say is, set the sidebar default state as display:none and then use grid break points such as <Col md={2} />
you can see this question for more details antd hide on smaller view

Further customise a jQueryMobile custom select menu

Does anyone one know of a workaround/hack ;¬) to further customise jQuery custom select menu - i.e. when we've used
$(document).bind('mobileinit',function(){
$.mobile.selectmenu.prototype.options.nativeMenu = false;
});
to give us a nice list-item overlay in place of the standard listview page on selecting from a select menu.
The jQM docs here http://jquerymobile.com/demos/1.2.1/docs/forms/selects/custom.html - state:
When it has too many options to show on the device's screen, the
framework will automatically create a new "page" populated with a
standard listview for the options. This allows us to use the native
scrolling included on the device for moving through a long list.
I would like to prevent this and always show the custom overlay; obviously the problem is scrolling the options which are out of view. When my project is switched to landscape thus decreasing the screen height it swithces to the 'old school', clunky listview. I should imagine its down to 'absolute' screen metrics since i can see the custom menu overlay will (just about) fit without reverting to the standard view.
The custom view is a much nicer looking interface, and more intuitive from a UI/UX perspective also.
Anyone know of any tricks to keep this behavior??

how to make only a part of screen scrollable

I've developed menu tabs in Tabs. jsp and included it in my Main.jsp . Now is it possible to make the Tabs not scroll in the jsp (i,e) the file that is included should not be scrolling down. How do i do this?
This has got nothing to do with Struts2, what you need is a floating menu which shouldnt scroll and should be fixed, there are multiple ways of doing it, one very simple but nice way can be found here

How to dynamic loade pages and using IScroll

I am using IScroll to help position a footer in the bottom of the screen on my PhoneGap application, but I have a problem I have struggling with for a few nights, so I hope some of you might be able to help.
To be able to persist my header and footer through the application I have been using something similar to this.
Usually I would bind on my PageCreated event, but since this is not execute I can't do that. I have tried after the page is received and I have called jQuery('#mobilePage').trigger('create'); to call setTimeout(function(){ myScroll.refresh(); },0);.
The issue is that the height isn't generated correctly. Half of the time some of the content is hidden beneath the footer.
My theory is that trigger('create') takes som time to call, and I therefore call myScroll.refresh() too early.
My question is there if there is a way to bind up on the trigger('create') event so I can create a callback and execute the scroll update?
in iscroll code, check for
checkDOMChanges
and make it true. then iscroll will handle setting up of the refresh whenever dom changes
try this jsfiddle link I think it will help you

How make jQuery UI Dialog be draggable outside of viewpoint too?

For now, it's only draggable within viewpoint.
You can't do this, it's part of the page/frame it's in. If this were allowed, you'd see advertisements outside the frame as well :)
If you want to drag it outside of the scrolled view in the page, that's the default behavior, you can test it here.
Nick Craver, I think you did not understand me. If you set up a simple div element to be draggable, you could drag it beyond the viewpoint. But that just doesn't work you use the dialog. What ads are you talking about?

Resources