
內容簡介
Sravnitel 是一款由 Elphel Inc. 基於 jQuery 插件 jquery.sravnitel.js 開發的 WordPress 外掛。
功能
比較 2 張或更多張圖片
可縮放和移動圖片
可設定初始縮放和位移
支援觸控事件:點擊、拖曳和手勢縮放
使用提示
在視窗區域點擊可快速切換左右圖片
在右上方的縮放訊息處點擊可將圖片縮放至適合視窗大小
若需使用多個本外掛,請為每個實例指定唯一的編號:[sravnitel id=’test1′ …],[sravnitel id=’test2′ …]
工作範例
Elphel's Blog: Lapped MDCT-based image conditioning with optical aberrations correction, color conversion, edge emphasis and noise reduction
簡單範例
將圖片縮放至視窗大小,不顯示標題:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480]
將圖片縮放至視窗大小,顯示標題和開關按鈕:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480 showtitles=true showtoggle=true]
將圖片縮放至視窗大小,顯示標題:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480 showtitles=true zoom=0]
將圖片縮放至 30%,顯示標題,並使左上角座標為視窗中心:
[sravnitel images=’ID0,ID1,ID2′ width=640 height=480 showtitles=true zoom=0.3 center_x=0 center_y=0]
短碼參數
id – int – 0 – 包含 <div> 元素的 ID
images – str – ” – (必填) 圖片 ID 列表,以逗號分隔
width – int – 530 – 視窗寬度(像素)
height – int – 300 – 視窗高度(像素)
showtitles – bool – false – 顯示/隱藏標題
showtoggle – bool – false – 顯示/隱藏按鈕,用於切換左右圖片
index_l – int – 0 – 設定左邊的圖片,此參數為圖片 ID 在列表中的索引,從 0 開始
index_r – int – 1 – 設定右邊的圖片,此參數為圖片 ID 在列表中的索引,從 0 開始
zoom – float – 0 – 設定初始縮放大小,0 表示縮放至視窗大小,1.0 表示 100%
center_x – int – 0 – 設定初始左上角座標(原始圖片座標系),以視窗中心為基準
center_y – int – 0 – 設定初始左上角座標(原始圖片座標系),以視窗中心為基準
外掛標籤
開發者團隊
原文外掛簡介
Sravnitel is a WordPress plugin by Elphel Inc. based on a jQuery plugin jquery.sravnitel.js.
Features
Compare 2+ images
Zoom and pan
Initial zoom and offset
Touch events: click, drag, pinch to zoom
Tips
Click on the view area to quickly switch between left and right image
Click on the zoom info in the top right to zoom-to-fit the view area
To place several instances of the plugin assign unique ids: [sravnitel id=’test1′ …], [sravnitel id=’test2′ …]
Working demo
Elphel’s Blog: Lapped MDCT-based image conditioning with optical aberrations correction, color conversion, edge emphasis and noise reduction
Quick examples
Fit image into the view window, w/o titles:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480]
Fit image into the view window, with titles and toggle button:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480 showtitles=true showtoggle=true]
Also fit image, with titles:
[sravnitel images=”ID0,ID1,ID2″ width=640 height=480 showtitles=true zoom=0]
Zoom 30%, with titles, x=0 and y=0 in the center of the view window:
[sravnitel images=’ID0,ID1,ID2′ width=640 height=480 showtitles=true zoom=0.3 center_x=0 center_y=0]
Shortcode Parameters
id – int – 0 – wrapper’s
images – str – ” – (required) list of images ids (attachment_id), comma separated
width – int – 530 – view window width px
height – int – 300 – view window height px
showtitles – bool – false – show/hide titles
showtoggle – bool – false – show/hide button – switch between left and right image
index_l – int – 0 – init, left image – is the index of the images array, starting from 0
index_r – int – 1 – init, right image – is the index of the images array, starting from 0
zoom – float – 0 – init, zoom, 0 – fit to view window, 1.0 – 100%
center_x – int – 0 – init, x coordinate of the original image to be placed in the center of the view window
center_y – int – 0 – init, y coordinate of the original image to be placed in the center of the view window
