0.2.1 • Published 9 years ago

jq-plugin v0.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

jEngine: jq-plugin

Bower version npm version Build Status

Installation

npm install jq-plugin --save

or

bower install jq-plugin --save

Demo

http://plnkr.co/edit/NSaBssbFXBjDcIRljy92?p=preview

http://codepen.io/jgermade/pen/YyrRGL?editors=101

Usage

$.plugin

<button class="click">Click Me</button>
$.plugin('button.click', function () {
  var jBtn = $(this),
      alt = false;

  jBtn.click(function () {
    alt = !alt;
    if( alt ) {
      jBtn.text('it works!');
    } else {
      jBtn.text('Click Me');
    }

  });
});

$.widget

<div data-widget="test">
  <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ul>
</div>
$.widget('test', function () {
  console.log('widget', this);

  $(this).find('li').hover(function() {
      this.style.fontWeight = 'bold';
    }, function() {
      this.style.fontWeight = 'normal';
    });
});
0.2.1

9 years ago

0.2.0

9 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago