我怎样才能重新呈现Pinterest的的脚It按钮? [英] How can i rerender Pinterest's Pin It button?

查看:129
本文介绍了我怎样才能重新呈现Pinterest的的脚It按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建和操作页面加载后,别起来按钮。当我与js的改变按钮的属性,应该重新呈现得到钉扎动态加载的图像的功能。那么,是否Pinterest的有一个像Facebook的B.XFBML.parse任何方法()函数?

I'm trying to create and manipulate the Pin It button after page load. When i change the button properties with js, it should be rerendered to get the functionality of pinning dynamically loaded images. So, does Pinterest have any method like Facebook's B.XFBML.parse() function?

谢谢...

推荐答案

只需添加数据引脚版本属性添加到 SCRIPT 标签:

Just add data-pin-build attribute to the SCRIPT tag:

<script defer
  src="//assets.pinterest.com/js/pinit.js"
  data-pin-build="parsePinBtns"></script>

这使得 pinit.js 其内部建立函数暴露在全球窗口对象 parsePinBtns 的功能。

That causes pinit.js to expose its internal build function to the global window object as parsePinBtns function.

然后,你可以用它来解析隐式元素或所有页面上的链接的链接:

Then, you can use it to parse links in the implicit element or all of the links on the page:

// parse the whole page
window.parsePinBtns();

// parse links in #pin-it-buttons element only
window.parsePinBtns(document.getElementById('#pin-it-buttons'));

提示:以显示零数只加数据引脚零=1 SCRIPT 标记。

Hint: to show zero count just add data-pin-zero="1" to SCRIPT tag.

这篇关于我怎样才能重新呈现Pinterest的的脚It按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆