本文整理匯總了TypeScript中perfect-scrollbar.update函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript update函數的具體用法?TypeScript update怎麽用?TypeScript update使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了update函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: update
/**
* Update the scrollbar
*/
update(): void
{
if ( !this.isInitialized )
{
return;
}
// Update the perfect-scrollbar
this.ps.update();
}
示例2: documentClick
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Document click
*
* @param {Event} event
*/
@HostListener('document:click', ['$event'])
documentClick(event: Event): void
{
if ( !this.isInitialized || !this.ps )
{
return;
}
// Update the scrollbar on document click..
// This isn't the most elegant solution but there is no other way
// of knowing when the contents of the scrollable container changes.
// Therefore, we update scrollbars on every document click.
this.ps.update();
}
示例3: require
import * as Ps from 'perfect-scrollbar'
const container = document.body
// 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($)
示例4: update
update() {
PS.update(this.$element);
}
示例5: updateScrollbar
private updateScrollbar(): void {
const container = this.elementRef.nativeElement.querySelector('md-nav-list');
Ps.update(container);
}