getComponent

eCatalog檢視器的JavaScript API參考

getComponent(componentId)

傳回檢視器使用之檢視器SDK元件的參考。 網頁可使用此方法來擴充或自訂現成檢視器的行為。 只有在initComplete檢視器回呼執行後才呼叫此方法,否則檢視器邏輯尚未建立元件。

參數

*componentID* —— 檢 {String} 視器使用之檢視器SDK元件的ID。此檢視器支援下列元件ID:

元件ID

檢視器SDK元件類別名稱

parameterManager

s7sdk.ParameterManager

容器

s7sdk.common.Container

mediaSet

s7sdk.set.MediaSet

pageView

s7sdk.set.PageView

primaryControls

s7sdk.common.ControlBar

secondaryControls

s7sdk.common.ControlBar

gridView

s7sdk.set.ThumbnailGridView

tableOfContents

s7sdk.set.TableOfContents

infoPanelPopup

s7sdk.info.InfoPanelPopup

imageMapEffect

s7sdk.image.ImageMapEffect

leftButton

s7sdk.common.PanLeftButton

rightButton

s7sdk.common.PanRightButton

zoomInButton

s7sdk.common.ZoomInButton

zoomOutButton

s7sdk.common.ZoomOutButton

zoomResetButton

s7sdk.common.ZoomResetButton

secondaryZoomResetButton

s7sdk.common.ZoomResetButton

thumbnailPageButton

s7sdk.common.ThumbnailPageButton

fullScreenButton

s7sdk.common.FullScreenButton

toolBarLeftButton

s7sdk.common.PanLeftButton

toolBarRightButton

s7sdk.common.PanRightButton

firstPageButton

s7sdk.common.PanLeftButton

secondaryFirstPageButton

s7sdk.common.PanLeftButton

lastPageButton

s7sdk.common.PanRightButton

secondaryLastPageButton

s7sdk.common.PanRightButton

closeButton

s7sdk.common.CloseButton

socialShare

s7sdk.share.SocialShare

twitterShare

s7sdk.share.TwitterShare

facebookShare

s7sdk.share.FacebookShare

linkShare

s7sdk.share.LinkShare

emailShare

s7sdk.share.EmailShare

embedShare

s7sdk.share.EmbedShare

列印

s7sdk.share.Print

下載

s7sdk.common.下載

favoritesEffect

s7sdk.favorites.FavoritesEffect

favoritesView

s7sdk.favorites.FavoritesView

favoritesMenu

s7sdk.favorites.FavoritesMenu

addFavoriteButton

s7sdk.favorites.AddFavoriteButton

removeFavoriteButton

s7sdk.favorites.RemoveFavoriteButton

viewAllFavoriteButton

s7sdk.favorites.ViewAllFavoriteButton

使用SDK API時,請務必依照檢視器SDK命名空間中所述,使用正確的完全限定SDK命名空間。

如需特定元件的詳細資訊,請參閱​檢視器SDK API​檔案。

傳回

{Object} 檢視器SDK元件的參考。如果componentId不是支援的檢視器元件,或檢視器邏輯尚未建立元件,則此方法會傳回null

範例

<instance>.setHandlers({ 
 "initComplete":function() { 
  var pageView = <instance>.getComponent("pageView"); 
} 
})

本頁內容

Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now