开发者 | mrwiblog |
---|---|
更新时间 | 2015年4月21日 04:58 |
捐献地址: | 去捐款 |
PHP版本: | 2.7 及以上 |
WordPress版本: | 2.8.4 |
PerformerJS allows you to add really cool effects and features to your website by doing some simple editing of the HTML code in your pages. It allows you to affect stuff on your page, just like the clever JavaScript guys do, without writing any JavaScript. Yes, even AJAX.
I think that Performer has the potential to make life much easier for website developers who want to get the basics done quickly. A lot of those developers use Wordpress to create sites, so a simple plugin was a no-brainer.
Performer is pretty simple. First it detects if one of the supported JavaScript libraries is present (jQuery, MooTools and Prototype). If so it goes through the page looking for Performer CSS classes (such as 'toggler', 'loader' and 'pager'). Based on other CSS classes - which I call 'CSS-parameters' - Performer sets up simple JavaScript listeners to catch interaction events. For example, for every 'toggler' link on the page Performer will attach a click listener to the link so then it is clicked the visibility of the target element is toggled. Simples. There's loads more information in the Documentation.
This plugin simply includes the Performer JavaScript file using the 'admin_head' (yes, Performer in the admin area) and 'wp_foot' hooks. However it first checks to see if one of the support JavaScript libraries is present, and if not includes the jQuery library using the Google AJAX API.