Related to this "problem", here is a iUI modification i'd like to
submit to the list for reviewing.
If an anchor link has the prefix "iuist-" (which stand for iui scroll
to), iUI will not try to go navigate with ajax to a screen but will
use default browser behavior.
Result is a normal inside page anchor navigation scroll
in iui.js
Change
addEventListener("click", function(event)
{
var link = findParent(event.target, "a");
if (link)
{
function unselect() { link.removeAttribute("selected"); }
if (link.href && link.hash && link.hash != "#" && !link.target)
{
followAnchor(link);
}
...
by
addEventListener("click", function(event)
{
var link = findParent(event.target, "a");
if (link)
{
function unselect() { link.removeAttribute("selected"); }
if (link.href && link.hash && link.hash != "#" &&
link.hash.indexOf("#iuigoto") == -1 && !link.target)
{
followAnchor(link);
}
elseif (link.href && link.hash && link.hash.indexOf("#iuigoto")
> -1)
{
location.href = link.href;
}
....
You can preview this modification on this example:
http://we-are-gurus.com/labs/iui/sandbox/anchor/
It will not break backbutton to go back to previous screen, but since
it changes the anchor value, browser back button is "goofed" so you'll
have to press it twice, one time that will scroll you back on top, and
a second time to go back (a fix in iui.goBack() could help with that)
That's not a big deal anyway...
Thoughts?
R.
Le 18 févr. 11 à 21:02, Mogens Beltoft a écrit :
Oh, I didn't "view source".
How about this jQuery plugin then?
http://plugins.jquery.com/project/ScrollTo
"Will add a scroll effect, to any anchor navigation"
/Mogens
On 18-02-2011 20:53, Rémi Grumeau wrote:
eh eh :)
Of course it's not that easy... in order to assure direct linking +
browser back button support, mobile web ajax framework uses anchors
to identify "screens"
iUI, JQTouch, JQueryMobile, Sencha, ... any of them that provide
transitions between pages do the same.
So you can't use anchors to scroll up or down in a screen with
those frameworks.
I know, that's a bummer...
i'm sure you can scroll using JS since iScroll does it, but i have
no idea how to do so using JQTouch.
R.
Le 18 févr. 11 à 19:19, Mogens Beltoft a écrit :
Hi,
Page jumps are easy!
The structure is:
<a name="top"></a>
<a href="#top">link to top</a>
So, basically what you need to do is to add a name="A" attribute
to the first link you have with a town starting with A. And so on
for B, C etc.
Then your new line with the alphabet needs to be constructed of a
series of <a href="#A">A</a> links, one for each letter.
/Mogens
On 18-02-2011 10:46, [email protected] wrote:
hi,
I have a large list of UK towns, see here:
http://www.mypubspace.com/mobile/index.php#towns
I would like to add an a-z link so that when a user clicks on say
'W'
they are then presented with the towns that begin with 'W'
Can anyone help?
thanks
--
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
.
--
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
.
--
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
.
--
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.