This project is released under the MIT license
I only ask that you check out Dash, my Snippet Manager and Documentation Browser app.
Two-finger swipes in a WebView? Done.
Two-finger swipes in a WebView? Done.
License: MIT License
This project is released under the MIT license
I only ask that you check out Dash, my Snippet Manager and Documentation Browser app.
Two-finger swipes in a WebView? Done.
To reproduce, change the example page.html
and wrap the entire contents of the body in the following tags:
<div style="height:500px; width:700px; overflow:auto;">
man page here
</div>
You will see that it is barely possible to go back/forward by swiping to the left/right when the mouse is in the content area even though there is no horizontal scroll bar.
It seems like the scrollWheel
callback in DHSwipeClipView
is not called often enough in this case.
SwipableWebView generates the following error message in the log:
*** WARNING: Method convertPointToBase: in class NSView is deprecated on 10.7 and later. It should not be used in new applications.
Btw. NSLeftMouseDown
is deprecated in 10.12.
I recommend the usage of the new WKWebView technology which provides gesture functions in the IB.
Hi,
The bug I was having was that the indicators that appear when you swipe were displaying behind certain DOM elements within my web view (I heavily use zIndex CSS properties on my elements).
In order to fix this problem I modified - (void)launchDrawTimer of DHSwipeClipView.m to the following:
- (void)launchDrawTimer
{
// a timer is needed because events are queued and processing and drawing
// takes longer than they are delivered, so the queue fills up
if(!drawTimer || ![drawTimer isValid])
{
self.drawTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f/25 target:webView.swipeIndicator selector:@selector(display) userInfo:nil repeats:NO];
// keep indicators at top (I added this)
NSView *v = webView.swipeIndicator.superview;
[webView.swipeIndicator removeFromSuperview];
[v addSubview: webView.swipeIndicator];
}
}
Did I miss something? Or should I be fine doing this.
I have the swiping enabled for three fingers,
System Preferences > Trackpad > More Gestures > Swipe Between pages
therefore, it won't work with either two or three fingers...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.