Code Monkey home page Code Monkey logo

jsel's Introduction

jSel


This is “Visual selection of elements for jQuery framework” Check out the demo

Required

  • jQuery framework >= 1.8
  • [* JRE for build]

Features

  • Light weight (min. 5KB code)
  • Cross browser support (IE, Chrome, Firefox, Opera, Vivaldi)
  • Wide API interfaces
  • A large field of activity
  • Customize the way you like

How to Use

Install the jsel in the footer

<script src="/javascript/jsel.jquery.min.js"></script>
<script>$(function() {$('body').jsel('events': {}).setActive()});</script>

or add special class for your element <body class="jsel-trigger">.

Options

Option Default Description
active false [boolean] Enable by default
breakCode 27 [number] Code button for unselected (default ESC)
borderSize 2 [number] Border size selected object
useLabel true [boolean] Use label for selected object
useEvent true [boolean] Use events for selected object
events {} [object] Available events

Callback

Option Default Description
callback.init null [function] Callback init wrapper
callback.select null [function] Callback selected object

Example of use

$(function ()
{
  $('body').jsel({
    'events':
    {
      'delete':
      {
        'label': 'Delete',
        'callback': function (element)
        {
          var newPos = element.next().length ? element.next() : element.parent();
          element.remove();
  
          // reload selected
          this.setInactive();
          newPos.length && this.setPosition({target: newPos});
          this.setActive();
         }
      },
      'show':
      {
        'label': 'Show Selector',
        'callback': function (element)
        {
          alert(this.getSelector(element));
        }
      }
    }
  }).setActive();
});

Build

cd ~ && git clone https://github.com/demorfi/jsel.git jsel && cd jsel
make && ls builds -lX

# rebuild
make clean && make && ls builds -lX

or use ready files in directories.

Change Log

v1.0 - Aug 02, 2015

  • Initialize version 1.0

License

This is licensed under the MIT License.

jsel's People

Contributors

demorfi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.