0712-2888027 189-8648-0214
微信公眾號(hào)

孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號(hào)

當(dāng)前位置:主頁(yè) > 技術(shù)支持 > Javascript/JQuery > jQuery imgBox一款圖片點(diǎn)擊放大瀏覽插件

jQuery imgBox一款圖片點(diǎn)擊放大瀏覽插件

時(shí)間:2024-09-20來(lái)源:風(fēng)信官網(wǎng) 點(diǎn)擊: 2500次
jQuery imgBox一款圖片點(diǎn)擊放大瀏覽插件,點(diǎn)擊圖片,彈出瀏覽窗口,就可以批量瀏覽,演示效果截圖如下:
 
項(xiàng)目地址:https://github.com/tsi/jQuery.imgBox
 
下載地址:https://github.com/tsi/jQuery.imgBox/zipball/master

jQuery imgBox一款圖片點(diǎn)擊放大瀏覽插件
 
引入文件
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="imgBox/jquery.imgbox.js"></script>
<link rel="stylesheet" href="imgBox/imgbox.css" />
 
對(duì)html中a標(biāo)簽進(jìn)行圖片集合瀏覽,給<a>標(biāo)簽的title添加內(nèi)容,會(huì)在彈窗中顯示
 
<a title="Lorem ipsum dolor sit amet" href="big_image1.jpg"><img src="thumb1.jpg"/></a>
<a title="Consectetur adipiscing elit" href="big_image2.jpg"><img src="thumb2.jpg"/></a>
<a title="Vivamus tincidunt massa in turpis" href="big_image3.jpg"><img src="thumb3.jpg"/></a>
 
JQuery控制代碼:
 
$("a").imgbox();
 
參數(shù)選項(xiàng):
 
$("a").imgbox({
  padding: 10,               // Set the padding/transparent border around the image.
  border: 2,                 // Set the solid border around the image.
  alignment: 'center',       // Position - may be auto OR center.
  allowMultiple: false,      // Allow opening multiple imgBoxes.
  autoScale: true,           // Scale the image to fit the available space.
  speedIn: 500,              // Set the zoom-in speed.
  speedOut: 500,             // Set the zoom-out speed.
  easingIn: 'swing',         // Set the zoom-in animation easing.
  easingOut: 'swing',        // Set the zoom-out animation easing.
  zoomOpacity: false,        // If true, changes image transparency when zooming.
  overlayShow: true,         // Display an overlay under the imgBox.
  overlayOpacity: 0.7,       // Set overlay opacity.
  hideOnOverlayClick: true,  // Hide imgBox when the overlay is clicked.
  hideOnContentClick: false, // Hide imgBox when the image is clicked.
  slideshow: true,           // Display next/previous controls.
  theme: 'light'             // Choose a color scheme (light/black).
});
 
參數(shù)的含義:
 
padding:彈窗中圖片的邊框,0為沒(méi)有邊框。
alignment:彈窗的位置,“auto”或“center”,默認(rèn)情況下,它從縮略圖所在方向擴(kuò)展彈窗
allowMultiple:如果選true,允許多個(gè)彈出窗口同時(shí)打開(kāi)
autoScale:如果為true,彈窗會(huì)自適應(yīng)窗口的大小
speedIn、speedOut:打開(kāi)彈窗和關(guān)閉彈窗的速度,單位:毫秒
zoomOpacity:如果為true,會(huì)在彈窗縮放時(shí)改變透明度
overlayShow:如果為true,會(huì)有遮罩層(默認(rèn)為false;遮罩層的顏色在css中設(shè)置)
overlayOpacity:遮罩層的透明度(取值范圍0~1)
hideOnOverlayClick:當(dāng)點(diǎn)擊遮罩層時(shí),關(guān)閉彈窗
hideOnContentClick:當(dāng)點(diǎn)擊圖片時(shí),關(guān)閉彈窗 
熱門(mén)關(guān)鍵詞: jQuery imgBox 圖片點(diǎn)擊放大 瀏覽插件

您可能感興趣的相關(guān)文章:

欄目列表
推薦內(nèi)容
熱點(diǎn)內(nèi)容
展開(kāi)