链接"用别针把它"在没有产生一个按钮,Pinterest的 [英] Link to "pin it" on pinterest without generating a button

查看:159
本文介绍了链接"用别针把它"在没有产生一个按钮,Pinterest的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数十或数百个职位,每一个社会按钮的页面。
我只是不能为每个URL所有的按钮:实在是太慢了(在Facebook,Google +,Twitter的,Pinterest的......数百链接)。所以,与其在飞行中产生的Facebook的分享按钮,我用一个简单的IMG指向

I have a page with tens or hundreds of posts, each one with social buttons. I just can't generate all the buttons for each url: it is too slow (facebook, g+, twitter, pinterest... for hundreds of links). So, instead of the facebook share button to be generated on the fly, I use a simple img pointing to

https://www.facebook.com/sharer.php?u=${url_of_current_post}&t=

当用户点击它,弹出一个窗口被Facebook生成的内容中打开。

When the user clicks on it, a popup window opens with content generated by facebook.

我怎样才能做到这一点对Pinterest的?我只有约code找到生成按钮,但我想避免JS在所有可能的话。有没有像下面这样?

How can I do it for Pinterest? I only find around code to generate the button, but I would like to avoid js at all if possible. Is there something like the following?

http://pinterest.com/pinthis?url=${url_of_current_post}

请不要试图让我使用JS按钮,谢谢。

Please do not try to make me use the js button, thanks.

推荐答案

标准Pinterest的按钮code(你可以这里产生),是一种< A> 标签内的< IMG> 的Pinterest的按钮。

The standard Pinterest button code (which you can generate here), is an <a> tag wrapping an <img> of the Pinterest button.

如果您不包括页面上的 pinit.js 脚本,这个&LT; A&GT; 标签将工作按原样。您可以通过这些标记与适当的尺寸打开一个新窗口注册自己的点击处理改善的经验,或者至少加入目标=_空白来标记,使它打开点击在新窗口中。

If you don't include the pinit.js script on your page, this <a> tag will work "as-is". You could improve the experience by registering your own click handler on these tags that opens a new window with appropriate dimensions, or at least adding target="_blank" to the tag to make it open clicks in a new window.

标签语法看起来像:

<a href="http://pinterest.com/pin/create/button/?url={URI-encoded URL of the page to pin}&media={URI-encoded URL of the image to pin}&description={optional URI-encoded description}" class="pin-it-button" count-layout="horizontal">
    <img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
</a>

如果使用共享按钮的JavaScript的版本正在毁掉你的页面加载时间,您可以通过使用异步加载方法来提高你的网站。对于使用Pinterest的按钮,这样的一个例子,看看我的 GitHub的Pinterest的按钮项目,改进的HTML5语法

If using the JavaScript versions of sharing buttons are ruining your page load times, you can improve your site by using asynchronous loading methods. For an example of doing this with the Pinterest button, check out my GitHub Pinterest button project with an improved HTML5 syntax.

这篇关于链接&QUOT;用别针把它&QUOT;在没有产生一个按钮,Pinterest的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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