happ-jquery

0.0.1 • Public • Published

HAPP-jQuery

Execution

var func = $(function (arg1, arg2) {
    // This code will be executed in the browser
    // ...
    return value;
});
 
func(arg1, arg2).then(function (value) {
    
});

Utils

$.alert('Message').then(function () {
    // ...
});
 
$.configm('Message').then(function () {
    // Confirmed
}, function () {
    // Declined
});
 
$.prompt('Message').then(function (inputText) {
    // ...
});
 
// console.log in browser
$.log('Message');

HTML content

$('selector').append(html);
$('selector').prepend(html);
$('selector').after(html);
$('selector').before(html);
$('selector').html();
 
$('selector').html().then(function (html) {
    // ...
});
 
$('.content').text('Hello, world!');
$('.content').text().then(function (text) {
    // ...
});
 
$('selector').remove();
$('selector').empty();

Classes & attributes

$('.item').attr('name');
$('.item').attr('name', 'username');
$('.item').removeAttr('name');
 
$('.item').addClass('active');
$('.item').removeClass('active');
$('.item').toggleClass('active');
$('.item').hasClass().then(function (result) {
    // ...
});

Forms

$('input').val('Hello');
$('input').val().then(function (value) {
    // ...
});

Size and position

$('.item').height();
$('.item').height(200);
 
$('.item').width();
$('.item').width(200);
 
$('.item').offset();
$('.item').position();
 
$('.item').scrollLeft();
$('.item').scrollTop();

Events

$('selector').on('click', function () {});

Styles

$.styleFile(filename);
$.styleCode(code);
$.styleLink(url);
 
$('selector').css('prop', 'value');
$('selector').css(object);
$('selector').css('display').then(function (value) {
    // ...
});
 
$('.item').hide();
$('.item').show();
 
$('.item').fadeIn();
$('.item').fadeOut();
$('.item').fadeToggle();
 
$('.item').animate(props, options).then(function () {
    // Completed
});

Readme

Keywords

none

Package Sidebar

Install

npm i happ-jquery

Weekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • ciphrus