[WordPress] 外掛分享: SNORDIAN’s H5P Resize Pulse

首頁外掛目錄 › SNORDIAN's H5P Resize Pulse
WordPress 外掛 SNORDIAN's H5P Resize Pulse 的封面圖片
300+
安裝啟用
★★★★★
5/5 分(2 則評價)
595 天前
最後更新
問題解決
WordPress 4.0+ v0.1.5 上架:2020-05-18

內容簡介

注意:我花了一些自己的空閒時間來創建這個外掛。使用它及其源代碼完全免費。我不想從您那裡得到任何錢。但是,如果您喜歡這個外掛,我請求您向 Rainforest Coalition(https://www.rainforestcoalition.org/donate)捐贈 2.50 歐元(如果您能負擔更多,也可以)。

H5P 是一個多功能的外掛,可在您的網站上添加互動內容。您可以嘗試運行它在其他外掛創建的一些字段中,例如選項卡、手風琴、燈箱等等。有些情況下,即使 H5P 是可運行的,當前內容設置為高度為 0 像素。這個問題在 https://h5p.org/manipulating-h5p-with-javascript 上有描述。

最好的解決方案是修改在包含選項卡等的 WordPress 網站上的外掛,但這並不總是可能的。在某些情況下,此外掛可能是可行的解決方案之一。

在“間隔”模式下,它將定期觸發 H5P 進行調整大小,這樣可以在許多情況下顯示它。但是,如果出現頻率太高,可能會導致瀏覽器停止運行。明智地選擇時間間隔!此外,某些 H5P 內容類型可能會被打破。唯一的解決方法是使用“選擇器”模式。

在“選擇器”模式下,您需要確定一個 CSS 選擇器,以識別您與其交互以顯示其他內容的所有元素,例如選項卡按鈕。如果在外掛的設置中設置了該選擇器,當單擊該元素時,它將觸發調整大小的信號。這樣,您就可以防止使瀏覽器停止運行或導致 H5P 內容類型被破壞。根據創建其他外掛的方式,可能不存在合適的 CSS 選擇器。

如有必要,您可以使用 manage_h5presizepulse_options 可能性來控制對外掛設置的訪問權限。

注意:H5P 是 H5P GROUP 的商標。此外掛既不是由 H5P GROUP 創建的,也未經他們認可。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.1.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「SNORDIAN's H5P Resize Pulse」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

PLEASE NOTE: I gave some of my free time to create this plugin. Using it and its source code is absolutely free. I don’t want any money from you. However, if you like this plugin, I kindly ask you to make a one-time donation of 2.50 EUR to the Rainforest Coalition (https://www.rainforestcoalition.org/donate) — or more if you can afford to.
H5P is a versatile plugin to add interactive content to your website. You may try to run it inside some fields that are created by other plugins, e.g. inside tabs, accordions, lightboxes, etc. And with some of them it seems that H5P doesn’t work although it is, but the content is set to a height of 0 pixels. That problem is described at https://h5p.org/manipulating-h5p-with-javascript.
The best solution would be to modify the plugin that’s including tabs, etc. to your WordPress site, but that’s not always possible. In some cases, this plugin may be a feasible workaround at least.
In “observer” mode, it will try to add a so called ResizeObserver to the container that holds the iframe with H5P content. That observer will send a resize pulse whenever the container changes in size, e.g. when it becomes visible. This should be a safe option just taking some extra resources.
In “interval” mode, it will trigger H5P to resize in regular intervals which should let it be displayed in many cases. However, if they appear too frequent, they may cause the browser to stall. Choose the time interval wisely! Also, some H5P content types may break that way. The only way around this is then the “selector” mode.
In “selector” mode, you need to determine a CSS selector that will identify all the elements that you interact with to display other contents, e.g. the tab buttons. If that selector is set in the plugin’s settings, it will trigger a resize pulse when that element is clicked. This way, you prevent stalling the browser or breaking H5P content types. Depending on how the other plugin was created, there may not ba a suitable CSS selector then.
If necessary, you can use the manage_h5presizepulse_options capability to control access to the plugin settings.
PLEASE NOTE: H5P IS A REGISTERED TRADEMARK OF H5P GROUP. THIS PLUGIN WAS NEITHER CREATED BY H5P GROUP NOR IS IT ENDORSED BY THEM.

延伸相關外掛

文章
Filter
Mastodon