items
Using Events
simpleCart(js) has lots of events that allow you to customize and modify the core functionality. You can add a callback to an event by using the simpleCart.bind() function:
simpleCart.bind( 'afterAdd' , function( item ){ alert( item.name + " has been added to the cart!"); });
Custom events
You can trigger custom simpleCart(js) events using the .trigger() function:
simpleCart.trigger( 'awesomeEvent' );
You can optionally send arguments to a triggered event by passing an array of values to .trigger():
simpleCart.trigger( 'awesomeEvent' , [ myfirstarg, mysecondarg ] );
Comments
- There are no comments for this entry yet.