poptrox点击图片弹出图层放大图片

来源:https://www.sucaihuo.com/js/2698.html 2017-08-12 12:36浏览(1566) 收藏

点击图片是弹出特效悬浮层,实现图片放大效果,poptrox图片放大插件
poptrox点击图片弹出图层放大图片
分类:悬浮层/弹出层 > 弹出层 难易:中级
查看演示 下载资源 下载积分: 30 积分

poptrox插件API设置

var settings = $.extend({
    preload: false, // If true, preload fullsize images in the background
    baseZIndex: 1000, // Base Z-Index
    fadeSpeed: 300, // Global fade speed
    overlayColor: '#000000', // Overlay color
    overlayOpacity: 0.6, // Overlay opacity
    overlayClass: 'poptrox-overlay', // Overlay class
    windowMargin: 50, // Window margin size (in pixels; only comes into play when an image is larger than the viewport)
    windowHeightPad: 0, // Window height pad
    selector: 'a', // Anchor tag selector
    caption: null, // Caption settings (see docs)
    parent: 'body', // Parent selector (ie. where all the popup/overlay stuff gets added).
    popupSpeed: 300, // Popup (resize) speed
    popupWidth: 200, // Popup width
    popupHeight: 100, // Popup height
    popupIsFixed: false, // If true, popup won't resize to fit images
    useBodyOverflow: false, // If true, the BODY tag is set to overflow: hidden when the popup is visible
    usePopupEasyClose: true, // If true, popup can be closed by clicking on it anywhere
    usePopupForceClose: false, // If true, popup can be closed even while content is loading
    usePopupLoader: true, // If true, show the popup loader
    usePopupCloser: true, // If true, show the popup closer button/link
    usePopupCaption: false, // If true, show the popup image caption
    usePopupNav: false, // If true, show (and use) popup navigation
    usePopupDefaultStyling: true, // If true, default popup styling will be applied (background color, text color, etc)
    popupBackgroundColor: '#FFFFFF', // (Default Style) Popup background color (when usePopupStyling = true)
    popupTextColor: '#000000', // (Default Style) Popup text color (when usePopupStyling = true)
    popupLoaderTextSize: '2em', // (Default Style) Popup loader text size
    popupCloserBackgroundColor: '#000000', // (Default Style) Popup closer background color (when usePopupStyling = true)
    popupCloserTextColor: '#FFFFFF', // (Default Style) Popup closer text color (when usePopupStyling = true)
    popupCloserTextSize: '20px', // (Default Style) Popup closer text size
    popupPadding: 10, // (Default Style) Popup padding (when usePopupStyling = true)
    popupCaptionHeight: 60, // (Default Style) Popup height of caption area
    popupCaptionTextSize: null, // (Default Style) Popup caption text size
    popupBlankCaptionText: '(untitled)', // Applied to images that don't have captions (when captions are enabled)
    popupCloserText: '×', // Popup closer text
    popupLoaderText: '••••', // Popup loader text
    popupClass: 'poptrox-popup', // Popup class
    popupSelector: null, // (Advanced) Popup selector (use this if you want to replace the built-in popup)
    popupLoaderSelector: '.loader', // (Advanced) Popup Loader selector
    popupCloserSelector: '.closer', // (Advanced) Popup Closer selector
    popupCaptionSelector: '.caption', // (Advanced) Popup Caption selector
    popupNavPreviousSelector: '.nav-previous', // (Advanced) Popup Nav Previous selector
    popupNavNextSelector: '.nav-next', // (Advanced) Popup Nav Next selector
    onPopupClose: null, // Called when popup closes
    onPopupOpen: null						// Called when popup opens

}, options);

poptrox使用方法:

<div id="gallery" class="pot">
    <a href="http://www.sucaihuo.com/jquery/20/2027/big.jpg"><img src="http://www.sucaihuo.com/jquery/20/2027/big.jpg"  alt="抓娃娃" title='抓娃娃'/></a>
    <a href="http://www.sucaihuo.com/modals/11/1145/big.jpg"><img src="http://www.sucaihuo.com/modals/11/1145/big.jpg" alt="ace后台" title='ace后台模板'/></a>
</div>

poptrox调用

$('.pot').poptrox({
    usePopupCaption: true
});

类似图片放大效果,可参考:http://www.sucaihuo.com/js/88.html

标签: 放大弹出层
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2