iPad: How to make a single swipe act like a mouse wheel scroll
I have been reading all the Apple documentation on how to handle various events with their touch screens. My problem is this:
I have an iframe in my webpage. Occasionally it is overfilled (this part is handle properly with the overflow attribute) and I cannot scroll the frame. The scroll bar pops up, but a swipe scrolls down the whole web page.
Apple says something to the effect of "... a swipe calls window.scroll() by default...". I have read various articles that say its POSSIBLE to change the default behavior for certain DOM objects, or disable it, or create your own behavior, etc. It sounds like any number of these solutions COULD work for me, but I can not find any examp开发者_如何学Goles nor fasion my own.
Can anyone help me with a link or example of an easy way to modify the style/events/attributes of my iframe so that I can scroll it with a normal one finger swipe on an iDevice?
Please Use,,UISwipeGestureRecognizer
...
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeRight:)];
swipeRight.numberOfTouchesRequired=1;
swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRight];
[swipeRight release];
}
- (void)handleSwipeRight:(UISwipeGestureRecognizer *)recognizer
{
//Your Coding
}
although NOT a solution to this problem, i solved my problem using this website -- webmanwalking.org/library/experiments/… -- i directed my ipad to the site, saw it function correctly, then made my page behave the same way. the biggest hurdle for me was i never knew there even WAS a multi finger swipe!
精彩评论