SETUP:
Using Google Apps Script's UI (doGet) with tabPanel option. At the bottom of each panel is a "previous" and "next" button to navigate through the tabs.
ISSUE:
When activating a navigation button the viewing area remains at the bottom of the screen.
QUESTION:
What code can be used to jump to the top of the screen? (i.e. window.scrollTo(0,0)
Unfortunately, there's no way to interact with the browser like this. But you can control the window scrolling if you wrap up all your GUI inside your own scroll panel, instead of using the browser's one.
Then, you can use the myScroll.setScrollPosition(y).setHorizontalScrollPosition(x).
using HtmlService with IFRAME mode...
$("html, body").animate({ scrollTop: 0 }, "slow");
Related
I found a really strange behavior when using a Materialize CSS modal in Firefox (66.0.1). It works fine in Chrome (73.0.3683.86) and MS Edge (where do you find the version?). I'm using Windows 10. It does this with the modal demo in the official Materialize CSS website as well.
The problem seems to start if you display a modal with enough content so that it displays a vertical scrollbar. It needs to have links or buttons to see the problem I will describe. You can simulate this by resizing Firefox so that its vertical height is small enough to make the scrollbar appear. Now close the modal. Then resize the height of Firefox so that the modal will appear without scrollbars. Open the modal and hover over a link or button and any hover effect that should happen, does not. Click once on any link or button and nothing happens. Click a second time and it works properly.
And even odder, after opening the first modal with a scrollbar, you can open the second without a scrollbar and do nothing for about 15 seconds and then the links or buttons will work fine.
When this happened, I tried right-clicking on the button to "inspect the element" in the Firefox Inspector. Instead of getting the button, I got the modal overlay element behind it. Note that when this happens, the overlay is not above the button or any of the modal content. It's not a z-index problem. To see whether it was a problem with the overlay, I added an onOpenEnd() function to the modal options that would remove the overlay as soon as the modal opened. I had the same problem. When I tried again to open it in the inspector, I got whatever was behind the button. So it's almost like the modal isn't even there until I click on the modal first or wait for 15 seconds.
I then tried to add some code to the onOpenEnd() function that would give focus to the button, but no effect with that. I tried tabbing to the button, but that didn't work either.
Just before submitting this I found another piece of the puzzle. As I said, hovering over the buttons when this is happening will not show the usual hover pointer. But if I hover above and a bit to the left of the buttons, the cursor does change. When I click there, the color of the buttons does change like it's been clicked, but the action (closing the modal) does not happen. Hmmmmm....
If you want to test this out, go to the Materialize CSS webisite and open the page for modals. (https://materializecss.com/modals.html) Reduce the vertical size of Firefox so that when you open the demo modal it has a vertical scrollbar. Now close the modal. Resize Firefox back to normal vertical height and open the modal again. Hover over the Agree or Disagree buttons and you won't get the pointer cursor. Try click once and nothing happens. Click again and the modal will close. Or wait the 15 seconds and then the buttons work.
Most of my users will have the modal open for more than 15 seconds so it's not a big problem. But sometimes they will open it just to check something and then want to close it. Sure they can click twice, but I'd rather it work properly. Chrome and Edge work fine. Firefox doesn't. Can anyone think of what is causing this and whether there is anything I can do in my code to make it work properly? Thanks.
I got a Home Page in my App which has a Menu button(Hamburger) on the Right of the Screen. My Requirement is to Animate the Current View(Home Screen or Profile Screen or Settings Screen ) on Tapping the Menu Button. On Tapping The Menu Button which Screen is Currently Active Should Animate.
The Requirement Screen Looks like the Image Below
The Image shows how the Screen looks like after tapping the Menu button.
ie: if Home Screen is active then the home screen should animate , if it is a profile screen which is active then the profile screen should animate. Can i make animations like this using Swift2. Currently i am using Xcode 7. For menu i am looking forward to use SWRealViewController. if i use SWrealViewController can i achieve this effect ? Or is there any third party Tool available ?
After a long Search for what i needed i just came to find a library. ITRAirSideMenu
Which is exactly what i was in search for.
You can try this Third party Library. Hope it helps you
https://github.com/DigitalLeaves/DLHamburguerMenu
I have a form application in C++ CLI. It has a scroll bar. I have a panel inside form and a number of picture boxes in it. The panel has auto scroll set. Is it possible that I can hide the panel auto scroll bar and control its scrolling by the form scroll bar.
The form screen shot is attached here
I tried changing the VerticalScroll.Visible property of the panel. But it doesn't help.
regards,
Rohini
In the latest version of OSX and safari you can use mouse swipe gestures to go forwards and backwards through your browser history. my problem: I have a page with a horizontally scrolling image gallery. If you're using the mouse swipe gesture to scroll through the images, when you get to the end of the images its very easy to swipe into the next or previous page...
does anyone know a way to explicitly disable this using css or any other method?
Perhaps the following documents can help:
Handling Gesture Events
Preventing Default Behaviour
: with event.preventDefault();
These might only apply to iOS though.
Aside from that, I would say it's just how the browser handles the gestures, similar to how mouse-wheel scrolling will scroll a DIV block until it reaches the end then start to scroll the page as a whole.
Unfortunately, there's no way to prevent this behaviour since it's a browser gesture (event.preventDefault() on touchstart event won't work).
I have an Enyo webOS application I am developing for phones. There are several text inputs on the main page, with a button underneath them--however, the button is not viewable below the textboxes. However, there appears to be a scroll lock by default on the main scene--so I cannot scroll down and see the rest of the content.
How can I enable my app to allow for scrolling within a VFlexBox view?
Thanks!
Ah, I found it--I need to change from enyo.VFlexBox to enyo.Scroller for the view. Works fine!