GithubHelp home page GithubHelp logo

andyhuang15 / nativeshare.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jefferywang/nativeshare.js

1.0 1.0 0.0 43 KB

一个在手机网页端可以直接调用原生分享的js

Home Page: http://blog.wangjunfeng.com/archives/618

License: MIT License

HTML 9.26% CSS 12.50% JavaScript 78.24%

nativeshare.js's Introduction

nativeShare

nativeShare是一个可以通过javascript直接调用原生分享的工具. demo

我们知道现在我们无法直接通过js直接跳转到微信和QQ等软件进行分享,但是现在像UC浏览器和QQ浏览器这样的主流浏览器自带一个分享工具,而他们也有自己定义的js接口.我们通过调用浏览器的接口去调用浏览器的分享,从而实现原生分享功能.是不是很酷呢?

该工具具有以下特点:

  • 支持原生微博、微信好友、微信朋友圈、QQ好友、QQ空间分享

  • 支持调用浏览器更多分享功能

  • 注意:目前仅支持手机UC浏览器和QQ浏览器

github项目地址: https://github.com/JefferyWang/nativeShare.js

Git@OSC项目地址: http://git.oschina.net/wangjunfeng/nativeShare.js

扫描二维码访问Demo

Demo

使用方法

  • 引入CSS文件
<link rel="stylesheet" href="nativeShare.css"/>
  • 在需要放分享的地方插入以下代码
<div id="nativeShare"></div>
  • 添加配置,并实例化
<script>
    var config = {
        url:'http://blog.wangjunfeng.com',// 分享的网页链接
        title:'王俊锋的个人博客',// 标题
        desc:'王俊锋的个人博客',// 描述
        img:'http://www.wangjunfeng.com/img/face.jpg',// 图片
        img_title:'王俊锋的个人博客',// 图片标题
        from:'王俊锋的博客' // 来源
    };
    var share_obj = new nativeShare('nativeShare',config);
</script>

截图

分享列表 微博分享 朋友圈分享 微信好友分享 QQ好友分享 QQ空间分享 更多

nativeshare.js's People

Contributors

jefferywang avatar xyyjk avatar

Stargazers

 avatar

Watchers

非鱼而渔 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.