hi guys,
i'm java boy, so don't know javascript internals (I'm using Google web
toolkit for ajax development),
What you can do is:
#1
invoke code in iUI to switch page to your correct page depending on
date/time value (showPage(...) is I'm not wrong is something used
in .js in iUI)
#2
after page is shown (transisionts ends) you need to scroll just showed
page to position where given html elemtn (these could be anything like
DIV or LI, should be no matter I think) so it is visible on its top
scroll position (as far scrolled down so it is fully visible),
in GWT we have a method implementation for that:
public native int getAbsoluteTop(Element elem) /*-{
var top = 0;
var curr = elem;
// This intentionally excludes body which has a null
offsetParent.
while (curr.offsetParent) {
top -= curr.scrollTop;
curr = curr.parentNode;
}
while (elem) {
top += elem.offsetTop;
elem = elem.offsetParent;
}
return top;
}-*/;
(everything within /*-{ .... }-*/ is javascript code discussed above)
then anytime I want I can scroll to given element within a page using
a code like:
// pseducode
let yPosition = get absolute top x for my element
//
let window scroll to 0 (x) yPosition (y)
(sorry for pseducode by that is written in Java),
Similiar approcach (automatic scrolling to some DOM element) is
implemented for example in Google feed reader example for iPhone where
they implement "scroll to last read item when going back to list of
items from detail page" pattern,
One thing to note: nothing above is availbe as is in iUI javascirpt I
think, but yoru html code will requrie quick few additions,
regards,
Peter
On Nov 8, 11:23 pm, alternapop <[EMAIL PROTECTED]> wrote:
> i have the javascript working that gets the current hour. if my html
> was just one long list, i know how to use an anchor to jump to a
> certain anchor.... but with iUI and iPhone hierarchical type list,
> how would can i jump to different unordered list?
>
> thanks...
>
> <body>
> <h4>
> <script type="text/javascript">
> <!--
> function goToAnchor(){
> var currentTime = new Date();
> var hours = currentTime.getHours();
>
> // get hour of day making sure it's an even number
> if (hours%2==1)
> {
> hours = hours - 1
> }
> else {
> }
>
> anchorname = hours;
> //-->
> }
> goToAnchor();
>
> </script>
> </h4>
>
> <div class="toolbar">
> <h1 id="pageTitle"></h1>
> <a id="backButton" class="button" href="Shuttle.html#"></a>
> </div>
>
> <ul id="home" title="Shuttle" selected="true">
> <li><a href="Shuttle.html#Location">Shuttles</a></li>
> </ul>
> <ul id="Location" title="Location">
> <li class="group"></li>
> <li><a href="Shuttle.html#Red">Red</a></li>
> <li><a href="Shuttle.html#Lime">Lime</a></li>
> </ul>
> <ul id="Red" title="Red">
> <li><a href="Shuttle.html#RedBart">16th Bart to MCB</a></li>
> <li><a href="Shuttle.html#RedMCB">MCB to MB CC</a></li>
> <li><a href="Shuttle.html#RedMBCC">MB CC to MCB</a></li>
>
> </ul>
> <ul id="Lime" title="Lime">
> <li><a href="Shuttle.html#LimeParnassus">Parnassus to MCB</a></
> li>
> <li><a href="Shuttle.html#LimeMCB">MCB to Parnassus</a></li>
> </ul>
>
> <ul id="RedBart" title="RedBart">
> <p><a name="6"></a> </p>
> <li>6:15 AM</li>
> <li>6:30 AM</li>
> <li>6:50 AM</li>
> <li>7:05 AM</li>
> <li>7:25 AM</li>
> <li>7:40 AM</li>
>
> <p><a name="8"></a> </p>
> <li>8:00 AM</li>
> <li>8:15 AM</li>
> <li>8:35 AM</li>
> <li>8:50 AM</li>
> <li>9:10 AM</li>
> <li>9:25 AM</li>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---