Issue when using position: fixed for toolbar in iOS 5 (iPad and iPhone) - iphone

There's an issue when accessing my website (http://www.zero11arquitetura.com.br) on iPad or iPhone with iOS 5 that I canĀ“t fix. When window is scrolled thru code every position:fixed elements click event stop working. Can you please help me ?
This site structure uses a top menu div and a header div with position: fixed css. When user clicks on a menu item window scrolls horizontally until it reaches its target.
Clicking in the menu item is done by jQuery click method on each img tag and scrolling is done by jQuery animate method ($("html:not(:animated),body").animate({ scrollLeft: varDestino }, 1500);)
When page is loaded the menu works just as I intended but, after it scrolls thru menu, and I try to click on another menu item nothing happens. The strangest thing is that everything works again when user manually scrolls the window (by finger).
It looks like that by changing window scroll position by code (jQuery calls window.scroll) fixed elements lost its clickable position references.
Is there any workaround for this ?
Thanks,

I've solved this with a trick. I've created invisible divs over the menu items that changes it's position when page scrolls (simulating afixed element over the real position: fixed menu items). When user clicks or hover over those invisble divs the real ones are called

Related

Unity Panel Interaction Issue

I have two panels in unity 2d directly overlapping each other and they use scroll panels so I can scroll down. I have it set so when one is accessed, the other is pulled up, but when they swap the other panel is grey and I cannot interact with it, but when I attempt to scroll the other panel scrolls instead, even though it is hidden and turned off.
I suspect that this is a bug in the code. It's possible, that when the user presses the scroll button in the first panel, and then releases the button, the second panel's scroll button thinks, it's already been pressed by the user, when in fact it isn't.
Set it up in such a way, that when you release the button on a scrollbar (the first scroll bar), it resets the click on the scrollbars connected to it (a second scroll bar).

select menu inside a div with fixed position on mobile safari, iphone

I am building a site that has a header with a fixed position which contains a select menu. The header is supposed to stay locked to the top of the screen due to the position:fixed in css. However, when clicking the select menu in mobile safari on iphone, the header no longer stays locked to the top when the ios select menu opens. It seems that ios is centering the div with the select menu onto the visible area of the screen above the menu. This doesn't happen when the page is scrolled to the top, but when the address bar is not visible, it "breaks" like so. Haven't found any other answers, maybe I'm asking the question the wrong way. I can't post links to code yet, any help is appreciated.
http://selfconstruc.tv/menu-open.PNG
http://selfconstruc.tv/menu-closed.PNG
For now I don't think there is a perfect solution to deal with the focus jumping.
In my case I hide the header on focus in and show again in focus out and it works well.
I don't know if in your case this could be a workaround.
You can try this:
// detect ios device
if(navigator.userAgent.match(/(iPad|iPhone|iPod)/gi)){
// hide header on focus in and show on focus out
jQuery("#content").focusin(function(){
jQuery('#your-header-id').hide();
})
jQuery("#content").focusout(function(){
jQuery('your-header-id').show();
})
}
The #content is a div where you should have all your controls, the jQuery .focusin() detects the focus event on parent elements, so every control will trigger the focus event. You hide the header on focus and show after that. Hope this helps!

Show popup/window in a gwt tab

Is it possible to show a popup only in a certain gwt tab or a panel in that tab?
I've found methods to show a popups over the whole page, but not only in specific tabs.
When you switch the gwt tab, the popup should not be visible anymore and new popups should be able to be created, which again are only visible in the switched to gwt tab. Switching back to the other tab should then show the first popup again.
Optionally the rest of the tab, which is not covered by the popup, should not be clickable.
Are there any native methods for this? The gwt Popup Panel only seems to create popups for the whole page.
Edit: I've tried using smartgwts Window which seems to work just the way I want it to. When I switch the gwt-tab, the popup is no longer visible and returns when I switch back. The only problem is, that it isn't displayed right. The frame is placed on the far left side of the browser tab, while the content is displayed on the far left of the gwt-tab. If I move the content, the frame moves too. The frame is visible over the whole browser tab, while the content disappears if I drag it over the gwt-tab edge.
I guess it's because I'm adding a Window to a gwt-Panel. Is there any way to fix this without changing everything to smartgwt?
Not exactly, I think.
But, you can do something in the tab events, like hide the popup in tabs that it doesnt belongs. To avoid the lag of show/hide the popup, you can do this in the BeforeSelectionHandler, like this:
getView().getTabPanel().addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>()
{
#Override
public void onBeforeSelection(BeforeSelectionEvent<Integer> event)
{
showPopupupsForTab(event.getItem());
}
});
In showPopupupsForTab you can show the popups for this tab (you can handle this with a map or something) and hide the others...
Something like this.
Hope it helps.

Cocos2d and UIScrollView

I am developing an IPhone cocos2d app with a scene like the the one depicted in the following image (I hope you can see that):
On the right there is a vertically scrollable menu contained in a separated layer (menulayer) which is itself contained in the main scene's layer. On the left there is a back button contained in the main scene's layer.
I am trying to exploit the UIScrollView as described in this link. However, despite I can see the UIScrollView working I am experimenting some problems:
1) while the menulayer actually scrolls it seems the menu does not. In fact when a press the menu item 8 the menu item 4 is selected, when I press the menu item 7 the menu item 3 is selected and so on.
2) the back button only works when the menulayer is at its first position
Do you have any idea of how shall I do to fix it?
You need to check you selectors. calls selectors from proper controls. check it carefully.Your problem shows your menu item 8 th selector bind with 4th same for others. some mis binding of selectors is present in your code so check them properly.

Drag/Slide div inside overflow:hidden container on iPhone

I am creating a wepapp, that has a horizontal menu. The menu is limited to 320px and has overflow set to hidden. Inside the links are wrapped in a div which has a width set to it. The list overflows on the x axis. I have applied a jquery plugin called OverScroll so you can drag this list left and right to reveal the hidden menu items.
It works great on a desktop browser but I am having difficulty on getting this to work on the iphone.
I have set up a demo at www.irfanyasin.com/iphone/
Any ideas?
Thanks
Apart from general usability issues (will people know it's slidable? I could see how this can be annoying if you use that menu often and have to slide it a lot), dragging doesn't work on most touch interfaces. You could try adding left and right buttons that scroll the menu when they click them maybe?
Also your demo doesn't work in Chrome on my desktop. Is the menu supposed to slide? It won't.