LiveWhale CMS

Welcome, Guest Login

Support Center

Our documentation is moving: docs.livewhale.com

Please check docs.livewhale.com for the most up-to-date LiveWhale CMS and LiveWhale Calendar documentation. The below legacy documentation will remain available as a reference until the documentation migration is complete.

Using JavaScript triggers for LiveWhale events

Last Updated: Mar 28, 2017 11:28AM PDT
You may want JavaScript or jQuery to run on certain widget results (for instance, applying a masonry plugin to some randomized images, or checking the dimensions or position of a news item). However, not all of those widget results will be visible or ready on page load.

In these cases, you can use the below triggers to run your own code after certain LiveWhale front-end events.


Paginated Widgets: After "Show More" or "View All" clicked (since 1.6.1)

$('body').bind('paginate.lw', function(e, el){

  // Exit the function if widget does not have class foo
  if ( !$(el.element).hasClass('foo') ) {
    return true;
  }

  // This part only executes for widgets with class foo
  // ...do something here after widget.foo has shown more paginated results
});


Randomized Widgets: After items have been randomized

$('body').bind('randomize.lw', function(e, el){

  // Exit the function if widget does not have class foo
  if ( !$(el.element).hasClass('foo') ) {
    return true;
  }

  // This part only executes for widgets with class foo
  // ...do something here after widget.foo has been randomized
});
eb8f96c071020d8b0923da726d6cab65@livewhale.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete?b_id=4256