nosOnShow

$container.nosOnShow([method[, options[, ...]]])

Special API which delays the rendering of UI elements when they become visible. A lot of UI elements don’t initialise correctly when they are hidden (they can’t calculate sizes properly).

This is a function with sub-functions.

Arguments:
  • method (mixed) – The sub-function name, show (default), one or bind. If omitted, this is the first parameter of the default sub-function nosOnShow.show().
  • options (mixed) – Parameters of the sub-function.

nosOnShow(‘show’)

nosOnShow.show()

Triggers all functions bounded with nosOnShow.bind() for any children of $container.

Warning

You have to actually show the element before calling this function.

$(domContext).show().nosOnShow();

// Or
$(domContext).show().nosOnShow('show');

nosOnShow(‘one’)

nosOnShow.one(callback)

Binds a callback function which will be called only the one time (at the first display).

Arguments:
  • callback (function) – A callback function.
$(element).nosOnShow('one', function() {
        $(this).widget();
});

nosOnShow(‘bind’)

nosOnShow.bind(callback)

Binds a callback function which will be called each time that the element becomes visible.

Arguments:
  • callback (function) – A callback function.
$(element).nosOnShow('bind', function() {
        $(this).widgetRefresh(); // widgetRefresh don't exist, it's an example.
});