views:

22

answers:

1

Hi there.
I have a webpage/webapp that works really good. Just 2 problems right now:

The statusbar of the iPad is not above the page, like i think it should be, but its in the page. So the top ~10px are overlayed by the statusbar and therefore my menu at this place is nearly unusable. I used 'black-transulent' but also 'black' as statusbar-styles.

Html links are leaving the webapp-mode. Well known problem. I found a solution which seems to come from the iWebKit:

var a=document.getElementsByTagName("a");
for(var i=0;i<a.length;i++)
{
    a[i].onclick=function()
{
    window.location=this.getAttribute("href");
    return false
}

But this overrides the click events from Javascript links that i have in my code. Is it possible to check if the click event is already set? JQuery allowed. If i check for $('ImAButton').click it always returns function.

A: 

If I understand your problem can you not call preventDefaults in the javascript event handler?

Hans B PUFAL
Thats what i do already. They work fine. But when i use the above method the click event will be overwritten and will not be executed. Because it sets a new onclick event for all links. Not only for links without onclick event. The problem is to get only links, that not have an onclick event yet.
Marks
OK I see, so instead of setting onClick can you use addEventListener?
Hans B PUFAL