- This topic has 11 replies, 3 voices, and was last updated 12 years, 10 months ago by Maloni.
-
AuthorPosts
-
djs84_deletedParticipantHi,
i habe a panel which has an height of 1000px.
is there a possibility to set an ancor to jump to the beginning of the panel or javascript scrolltop() feature?
<a href=”#top”>top</a> and <a name=”top”></a> doesn’t work 🙁
thx for help
djs84_deletedParticipantno one an idea?
support-michaelKeymasterI will post an example shortly.
support-michaelKeymasterHere is an example that will only scroll a panel to its top position.
Note: there is some quirk that I have not figured out yet that prevents this example and the api in use from providing universal panel positioning. So only use it to scroll to the top of a a panel.
Step-1: create your design with a panel and set its properties as follows
– enable vertical scrollbar
– increase the content area height property to a large value so the panel will scrollStep-2: generate code and inspect to find the panel’s scrollbar ID
See attachment scroll-to-top.png
Step-3: add widget that when selected can fire an On Change – Run JavaScript action, e.g., button or link widget
– Use the snippet of code shown below with the #m1-GotoTop- id changed to the id you discover when you look it up the generated HTML file$('#m1-GotoTop-')[0].myScroll.scrollTo(0,0,"500ms")
See attachment scroll-to-top-1.png
Step-4: save file and run in Test Center or on your device
Here is the .mobi design file used in this example. The button that initiates scrolling is at the bottom of the panel and offscreen. You can scroll the panel in the designer by selecting it and then hover your mouse over the right side scroller that appears. Then click and drag the scroller when it highlights as you fly over it.
Open it in the Design Center and click the Run in Test Center action.
See attachment GotoTop.mobiAttachments:
You must be logged in to view attached files.
djs84_deletedParticipantyou’re great.
thx man 🙂
djs84_deletedParticipantit Works Great in an iPhone but do you have a solution for android mobile Phones?
this Exempel at the Top doesnt work on android
support-michaelKeymasterThat will be coming soon when we roll out android support next month.
djs84_deletedParticipantif you have a small javscript code for android or another solution…you will make me very happy 😉
support-michaelKeymaster>if you have a small javscript code for android or another solution
We will not officially have android support for a few more weeks. In the meantime I’ll see if I can get something working.
djs84_deletedParticipantok…thx a lot
MaloniParticipant$(‘#m1-GotoTop-‘)[0].myScroll.scrollTo(0,0,”500ms”) in MobiOne Version 1.5 no function.
Got a tip?thx for help
MaloniParticipantHas done it!
In Version 1.5 is changes the id of the panel’s internal scrollers.
Previously in MobiOne 1.4.3: $ (‘#m1-GotoTop-‘) [0] myScroll.scrollTo (0,0, “500ms”)
Now in MobiOne 1.5: $ (‘#m1-GotoTop-panel1-scroller’) [0] myScroll.scrollTo (0,0, “500ms”)That’s all 😉
-
AuthorPosts