本文整理匯總了TypeScript中perfect-scrollbar.destroy函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript destroy函數的具體用法?TypeScript destroy怎麽用?TypeScript destroy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了destroy函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _destroy
/**
* Destroy
*
* @private
*/
_destroy(): void
{
if ( !this.isInitialized || !this.ps )
{
return;
}
// Destroy the perfect-scrollbar
this.ps.destroy();
// Clean up
this.ps = null;
this.isInitialized = false;
}
示例2: require
// To initialise the plugin, `Ps.initialize` is used.
Ps.initialize(container)
// It can be initialised with optional parameters.
Ps.initialize(container, {
wheelSpeed: 2,
wheelPropagation: true,
minScrollbarLength: 20
})
// If the size of your container or content changes, call `update`.
Ps.update(container)
// If you want to destroy the scrollbar, use `destroy`.
Ps.destroy(container)
// If you want to scroll to somewhere, just use a `scrollTop` property and update.
container.scrollTop = 0
Ps.update(container)
/**
* https://github.com/noraesae/perfect-scrollbar#jquery
*/
import mountJQuery = require('perfect-scrollbar/jquery')
mountJQuery($)
$('#container').perfectScrollbar() // Initialize
$('#container').perfectScrollbar({ /*...*/ }) // with options
$('#container').perfectScrollbar('update') // Update
示例3: ngOnDestroy
ngOnDestroy() {
PS.destroy(this.$element);
}
示例4:
scope.$on('$destroy', () => {
scrollbar.destroy();
});