GithubHelp home page GithubHelp logo

yixin.chat.js's Introduction

weiyixin.chat.js

一个微信和易信的分享的简单js,用来自定义用户分享后的“分享块”显示的内容~

微信/易信扫描下图二维码打开页面,并分享

nyphile

或微信/易信打开http://nyphile.github.io/Yixin.chat.js/

1.配置参数~

在页面中写入<script>标签,内容如下:

var shareData = {
	link : 'http://jiankang.163.com/special/weixin_quiz/',
	imgUrl : 'http://img1.cache.netease.com/f2e/health/weixin_quiz/images/120x120-5star.jpg',
	imgSize : '300',
	title : '测测你的“白领症”中招指数吧!',
	desc : '我刚测完自己的”白领症“中招指数,你也来测测你的“白领症”中招指数吧!',
	appid : '',
	callback : function(){
		document.getElementsByTagName("h1")[0].innerHTML="I'm back!";
	}
};

其中:

link:想让看到分享的用户点击的链接,不设置即为当前页面;

imgUrl:分享块左侧的图片;

imgSize:图片的尺寸;

title:分享块的标题文字,不设置即为当前页面title;

desc:分享块的描述文字,不设置即为当前页面title(在微信下,分享到朋友圈没有描述);

appid:app的id,可不设置;

callback:点击时触发的方法(是点击时,而非分享成功),可留空。

2.页面引入~

除了上述配置,再在配置之后引入js:

<script src="http://nyphile.github.io/Yixin.chat.js/weiyixin.chat.js"></script>

即可。

3.实现效果~

微信发给好友:

nyphile

微信发给好友圈:

nyphile

易信发给好友和发给朋友圈长得一样:

nyphile

最后感谢sofish同学的wechat.js~

yixin.chat.js's People

Contributors

nyphile avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

artdong

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.