There are many mainstream sharing tools now, such as JiaThis, bShare sharing, and even some big companies such as Baidu sharing, but they still only share on the PC side, and the support for mobile phones is not very good.
Everyone knows that many mobile browsers now have some built-in sharing components, such as UC Browser and QQ Browser. The built-in component sharing can directly start the corresponding APP sharing. If a JS can call the browser's built-in sharing Components, how cool is that.
Experts are among the people. The editor of Script House below will take you to take a look at the JS library written by this brother.
1. Tool introduction nativeShare.js
A tool that can directly call native sharing through javascript. This tool has the following characteristics:
1. Support native Weibo, WeChat friends, WeChat Moments, QQ friends, and QQ space sharing
2. Support calling more sharing functions of the browser
3. Does not rely on any jquery or other plug-ins
Note: Currently only mobile UC browser and QQ browser are supported
github project address: https://github.com/JefferyWang/nativeShare.js
Git@OSC project address: http://git.oschina.net/wangjunfeng/nativeShare.js
2. How to use
1.Introduce CSS files
2. Insert the following code where you need to add sharing:
3. Add configuration information and instantiate
3. Demonstration screenshots
Figure 1: Share to Sina Weibo
Figure 2: Share to WeChat Moments
Figure 3: Share with contacts on WeChat
Figure 4: QQ sharing to contacts
Figure 5: QQ sharing to space
Figure 6: Calling the browser’s built-in sharing component