July 6, 2007 12:00 AM PDT
The iPhone Web app navigation template
Web developer Joe Hewitt has created an ingeniously simple combination of JavaScript and CSS code that turns standards-based HTML lists into pages that act just like the iPod function on the iPhone -- sliding, navigable menus. To see just how well this template works, load this page on your iPhone:
The CSS and JavaScript files are located, respectively, at:
Feedback? info@iphoneatlas.com.


However, I now have difficulty cause I would like to navigate out of the page or submit a form to another page?
Any ideas?
Here is a PHP sample give a small rename file form:
<?php
$divs .= "<div id=\"rename-".md5( $dir."/".$item )."\" class=\"panel\" title=\"Rename ".$item."\">
";
$divs .= "<h2>Type in the new name:</h2>
";
$divs .= "<form name=\"rename-".md5( $dir."/".$item )."\" method=\"post\" action=\"index.php\" >
";
$divs .= "<input type=\"hidden\" name=\"from\"; value=\"".$dir."/".$item."\" />
";
$divs .= "<input type=\"text\" name=\"to\"; value=\"".$item."\" /><br />
";
$divs .= "<input type=\"submit\" name=\"action\"; value=\"rename\" />
";
$divs .= "</form>
";
$divs .= "</div>
";
?>
So when i click the submit button niks, nada, nothing....
Same goes I think for just generic links.... it doesn't go...
<?php
$divs .= "<a href=\"http://www.google.com\">google</a>
";
?>
Its like the javascript completely takes over and mods the links.
addEventListener("click", function(event)
{
var link = event.target;
while (link && link.localName.toLowerCase() != "a")
link = link.parentNode;
if (link && link.hash && link.href.indexOf("http://") === -1 )
{
event.preventDefault();
var page = document.getElementById(link.hash.substr(1));
showPage(page);
}
}, true);
- by vince1johnson November 4, 2009 11:54 AM PST
- In the iphonenav.js just delete line 32 "event.preventDefault();" and save...
- Like this Reply to this comment
-
(6 Comments)