( function ( $ ) {
// Create a new instance of Slidebars
var controller = new slidebars();
// Events
$( controller.events ).on( 'init', function () {
console.log( 'Init event' );
} );
$( controller.events ).on( 'exit', function () {
console.log( 'Exit event' );
} );
$( controller.events ).on( 'css', function () {
console.log( 'CSS event' );
} );
$( controller.events ).on( 'opening', function ( event, id ) {
console.log( 'Opening event of slidebar with id ' + id );
} );
$( controller.events ).on( 'opened', function ( event, id ) {
console.log( 'Opened event of slidebar with id ' + id );
} );
$( controller.events ).on( 'closing', function ( event, id ) {
console.log( 'Closing event of slidebar with id ' + id );
} );
$( controller.events ).on( 'closed', function ( event, id ) {
console.log( 'Closed event of slidebar with id ' + id );
} );
// Initialize Slidebars
controller.init();
// Left Slidebar controls
$( '.js-open-left-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.open( 'slidebar-1' );
} );
$( '.js-close-left-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.close( 'slidebar-1' );
} );
$( '.js-toggle-left-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.toggle( 'slidebar-1' );
} );
// Right Slidebar controls
$( '.js-open-right-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.open( 'slidebar-2' );
} );
$( '.js-close-right-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.close( 'slidebar-2' );
} );
$( '.js-toggle-right-slidebar' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.toggle( 'slidebar-2' );
} );
// Close any
$( controller.events ).on( 'opened', function () {
$( '[canvas="container"]' ).addClass( 'js-close-any-slidebar' );
} );
$( controller.events ).on( 'closed', function () {
$( '[canvas="container"]' ).removeClass( 'js-close-any-slidebar' );
} );
$( 'body' ).on( 'click', '.js-close-any-slidebar', function ( event ) {
event.stopPropagation();
controller.close();
} );
// Initilize, exit and css reset
$( '.js-initialize-slidebars' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.init();
} );
$( '.js-exit-slidebars' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.exit();
} );
$( '.js-reset-slidebars-css' ).on( 'click', function ( event ) {
event.stopPropagation();
controller.css();
} );
} ) ( jQuery );
Kodum yukaridaki gibi internetten yaptigim arastirmalar sonucu buldugum qguery eklentiside touchSwipe olarak geciyor. http://labs.rampinteractive.co.uk/touchSwipe/docs/index.html burdaki kodlari nasil kendi kodlarima uyarlayabilirim?