O'Reilly logo

PHP jQuery Cookbook by Vijay Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a jQuery plugin

This recipe will explain how you can create a simple jQuery plugin. The user will be able to enter two numbers and the plugin will count from the first number to the second number while animating just like how a stopwatch changes. We will call it Cash Counter. You will also be able to specify how fast or slow the animation runs.

Getting ready

Create a folder Recipe4 inside the Chapter9 directory.

How to do it...

  1. Create a file named index.html inside Recipe4 folder. In this file, create two text boxes to enter starting and end numbers, an h1 element to display the number as it changes, and a button to initiate the process.
    <html> <head> <title>Cash Counter</title> <style type="text/css"> body{ font-family:"Trebuchet MS",verdana,arial; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required