Check, whether a area is marked as "closed" for a certain time span.

This function returns true when the area is considered "closed". This function does not provide information, on how long the closed-state will last.


(string, required) ID/Key of the area. When no Area with the given ID exists on the current page, the key-string is treated like it is the final Area ID (see sample below).


Returns true when the given Area was marked as closed before. The return value is false, if the Area was not marked as closed, or if the closeFor duration passed - see DiviArea.markClosed() for details.


// Assume that the page contains the Area "#divi-area-test"
if ( DiviArea.isClosed('#divi-area-test') ) {
  // --> Checks the value of the localStorage entry "_da_divi-area-test".
  console.log('Area #divi-area-test is still closed');

// This happens, when the key is no valid Area ID:
if ( DiviArea.isClosed('Spaces In Key') ) {
  // --> Checks the value of the localStorage entry "_da_Spaces In Key".
  console.log('Spaces In Key is still closed');


No notes

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.