Scriptatype:PHP

Based on the Ruby on Rails plugin “Winn Scriptatype:Rails this php class works with Scriptalicious and Prototype. This is an easy class to start using; just include the winnscriptatype class and the two javascript librarys. Then make the php call and your done!

Install

  • Upload all the files to your server
  • Include the files listed below:
include 'path/to/class/winnscriptatype.php';
// Make the call
$w = new WinnScriptatype();

Now lets include the Javascript

<script src="js/prototypejs.js" type="text/javascript"><!--mce:0--></script>
<script src="js/scriptaculous.js" type="text/javascript"><!--mce:1--></script>

Test it out!

<table>
<tbody>
<tr id="thisrow" style="background: #333333 none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff;">
<td>$w-&gt;checkbox_do_fade('thisrow', 'mychkbox', 'sample_script.php', array('test' =&gt; '1')); ?&gt; This is my test.</td>
</tr>
</tbody>
</table>

All of the above code was taken from the sample.php file in the root of the Scriptatype download. Here’s how to make the correct formatted calls to this class.

$w-&gt;checkbox_do_fade('*', '**', '***', array('userName' =&gt; 'Bob'));
 
// * [Element ID] - This is the ID of the element you want the effect on.
// ** [CheckBox ID] - This is the ID of the CheckBox.
// *** [Script URL] - This is the url to the script that will execute when the user clicks the checkbox.
// Array - Provide extra options for the script each option will act as a KEY = VALUE
//            In the example above userName = Bob
//            the URL would be /path/to/script.php?userName=Bob
 
// = AVAILABLE CALLS
checkbox_do_fade
checkbox_do_puff
checkbox_do_blindup
checkbox_do_dropout
 
// two effects
checkbox_do_fade_and_appear
checkbox_do_fade_and_puff
checkbox_do_fade_and_blindup
checkbox_do_fade_and_blinddown
checkbox_do_fade_and_dropout
checkbox_do_fade_and_highlight

Now you can start using Winn Scriptatype in your next application or website!

Zip fileGet this script: Download Winn Scriptatype:php v1.5 Stable

Want the latest? Visit our SourceForge project page for the nightly dump!