Helpers for using jquery tools
JavaScript PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib/helper
test/phpunit/units
web
README
package.xml.tmpl

README

This is a helper for using Jquery Tools.  It handles creating the html and javascript needed using a helper in the view.

To use the helper, in your view include

`use_helper('jQueryTools');`

Then call the helper

`<?php echo jquerytools_overlay('#my-overlay', '<p>Hello World</p>', array{'effect'=>'apple'}) ?>`

It will give the following output

`<div class="apple_overlay" id="test"><p>Hello World</p></div>`
`<script>$(function(){$("img[rel]").overlay({"effect":"apple"});});</script>`

## Overlay ##

`jquerytools_overlay(id, content, options, tag='img')`

id is the unique identifier for this specific overlay.  Remember you must use this id as a trigger on a different element, using rel.  For example, if you overlay is called my-overlay and you triggered it off of an image, the image tag would look like `<img src="my-trigger-image.png" rel="my-overlay">`

content can be in the form of a partial, component, html or an external link

Options are all of the options that available to the [jQueryTools overlay function](http://flowplayer.org/tools/overlay/index.html) and a few additional only used for the helper.

* no-javascript - if set to true, javascript is not returned
* no-html - if set to true, html is not returned
* class - additional classes for the overlay div

**There is currently a bug that will not allow onBeforeLoad and other similar functions to create correctly.
The problem is with using json_encode().  It will be fixed at some point**

## Scrollable ##

`jquerytools_scrollable(id, items, options)`

id is the unique identifier for the scrollable items.

The items is an array of the indivual items that will be scrolled.

`$item = array('<p>Hello World</p>', '<p>Hello Whirled</p>');`

Options are all of the options that available to the [jQueryTools scrollable function](http://flowplayer.org/tools/scrollable/index.html) and a few additional only used for the helper.

* no-javascript - if set to true, javascript is not returned
* no-html - if set to true, html is not returned
* class - additional classes for the overlay div

**There is currently a bug that will not allow onSeekTo and other similar functions to create correctly.
The problem is with using json_encode().  It will be fixed at some point**

Testing is handled with the [sfPhpunitPlugin](http://www.symfony-project.org/plugins/sfPhpunitPlugin)