jquery weui 图片浏览器Photo Browser 如何使用?

PhotoBrowser 一款内存消耗少得图片浏览,非循环滚动。有需要的同学可以下载看看代码。 立即下载

对应组件地址:http://jqweui.com/extends#swiper

先说说业务场景:类似朋友圈这样的布局效果,点击小图可以浏览大图,并支持大图左右切换,效果图如下(加了滚动加载更多的操作在里面):

重点说明:该引入的js和swiper.js 都需要引入进去

<script src="../../res/js/jquery-2.1.4.js"></script>
<script src="../../res/js/jquery-weui.js"></script>
<script src="../../res/js/swiper.js"></script>

图片绑定的调用函数:用了es6的模板字符串的语法,很强大的``;

html += `<img class="list-img" onclick="showBigImg('${posterList.pictures}',${k})"  src="${strImg}" style="height: 80px;">`;

下面进入主题:

function showBigImg(list,index) {
    imgList = list.split(',');//list是一个图片url的字符串,以‘,’分隔的,这里把它转换成数组对象
    console.log('array',Array.isArray(imgList));
    //$.photoBrowser({items: imgList}).open(1);
    //pb1.items = imgList;
    //pb1.open();
    $.photoBrowser({
        items: imgList, //赋值
        initIndex: index, //当前点击的图片下标
        onSlideChange: function(index) {
            console.log(this, index);
        },

        onOpen: function() {
            console.log("onOpen", this);
        },
        onClose: function() {
            console.log("onClose", this);
        }
    }).open();//这里一定要这样调用一下
    
}

方案二:这样调用也是ok

function showBigImg(list,index) {
    imgList = list.split(',');
    console.log('array',Array.isArray(imgList));
    $.photoBrowser({items: imgList}).open(index);
   
    
}

遇到的问题:

如果是小图会出现下面的效果:

解决方案:解决方案的来源:https://github.com/lihongxun945/jquery-weui/issues/169

.weui-photo-browser-modal .photo-container { justify-content: center; }

刚刚试了一下,两个问题都有了解决方案,写在这里吧,或许有人用得上:

1.图片弹出置顶

onOpen:function(){$(this.modal).css('z-index',6666); }

2.防止图片过长

.weui-photo-browser-modal .photo-container img {
    max-height: 100%;
}
LabVIEW面向对象编程:操作者框架入门实战 本文是LabVIEW面向对象编程中操作者框架的入门实战指南。针对传统“面条式代码”在复杂项目中的维护难题,文章通过创建操作者、定义消息与处理函数、在主VI中调用等步骤,详细演示了如何利用操作者框架构建模块化、易扩展的应用程序架构,有效管理并行任务。 阅读详情

相关推荐

保姆级教程:用OpenCV和MediaPipe在Python里实现实时手势识别(附完整代码)

本文提供了一份详细的Python教程,教你如何使用OpenCV和MediaPipe实现实时手势识别系统。从环境配置、手部关键点检测到手势分类算法,逐步讲解如何构建高精度手势识别应用,适用于智能家居控制、PPT操作等场景。教程包含完整代码示例和性能优化技巧,特别适合计算机视觉初学者和开发者实践。

weixin_28677005的博客 327

weui 图片浏览器PhotoBrowser 的使用

jquery weui 图片浏览器PhotoBrowser 的简单使用 weui PhotoBrowser 地址链接 使用步骤 引入需要的js文件 <script src="/static/js/jquery-2.1.4.js"></script> <script src="/static/js/jquery-weui.js"></script> <script src="/static/js/swiper.js">&

呆鸟慢飞的博客 932

基于 openEuler 24.03 LTS 源码编译安装 Zabbix 7.4

Zabbix是一款开源的企业级分布式监控系统,支持网络、服务器、应用等多种IT资源的监控。核心功能包括数据采集、告警通知、可视化展示等,采用Server/Agent架构,支持多种操作系统。本文详细介绍了在openEuler 24.03系统上部署Zabbix 7.4.2的完整流程,包括环境准备、MySQL配置、PHP/Apache安装、Zabbix编译安装等步骤,为构建企业级监控系统提供了实践指导。

广然笔记 1190

jQuery weui Photo Browser 点击小图显示对应的大图

官网上只提供了点击按钮显示图片浏览。 但有时候我们需要点击对应的图片,显示大图 我在网上也找了好多,但关于jQuery weui Photo Browser图片动态加载的博客很少,本人菜鸟,自己琢磨出来了简单的方法,如果有更好的方法请赐教,谢谢     var listp=[];//创建数组,存储图片链接 $.showLoading(); $.ajax({ ...

汤玉鹏 4566

智能排班考勤系统原型

可实现从业务预测,到工时预估,再到人员分配全流程自动智能排班。可应用于客服行业或工厂的智能排班系统。

gywm15111336483的专栏 995

简化神经元模型6 -- Hindmarsh-Rose Model

简化神经元模型 6 Hindmarsh-Rose Model

weixin_73557167的博客 1426

Triton 构建系统与工具链实战指南:从一次 pip install 到内核排障

你在本机敲下 `pip install -e .` 的那一刻,Triton 构建系统就开始在后台分选依赖、配置后端、拉起 CMake。本文沿"在本机从零搭好 Triton 开发环境、跑通一次自定义构建并排障"这条主线,把这条工具链拆开看:它在哪读配置、在哪下载 LLVM、在哪把后端塞进 Python 包、又在哪吐出可调试的中间表示。适合有工程基础、刚接触该项目的开发者。 ## 从零开始:一条 p

gitblog_00682的博客 704

win10+conda+pytorch-gpu安装

pytorch 官网上只有linux和Mac的程序包,没有windows系统的,但是windows系统还是可以用pytorch的。  github: https://github.com/peterjc123/pytorch-scripts 首先要安装anaconda: 推荐清华镜像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ ...

一摩尔自由的博客 1万+

【亲测免费】 探索 PhotoBrowser:一款强大的图片浏览与管理工具

探索 PhotoBrowser:一款强大的图片浏览与管理工具 项目简介 PhotoBrowser 是一个由 CoderWhy 开发的开源项目,旨在为用户提供一个高效、美观且功能丰富的图片浏览和管理应用。这款应用程序支持多种操作系统,包括 Windows、MacOS 和 Linux,使用户可以在各种平台上轻松管理和欣赏他们的照片库。 技术分析 基于 Electron 构建 PhotoBrowser ...

gitblog_00025的博客 721

【C#程序员入门AI】AI应用的操作系统:Semantic Kernel 2026实战

用户ID用户信息

人工智能AI技术 1247

C++高级数据结构算法 | 二叉树的四种遍历算法详解(递归与非递归实现)

二叉树遍历方法 、前序遍历算法 、中序遍历算法 、后序遍历算法 、层序遍历算法

ZY-JIMMY 2562

使用WeUI图片显示和点击图片放大、点击图片缩小

<!-- [weui] --> <link rel="stylesheet" href="${staticPath }/css/weui.min.css"> <link rel="stylesheet" href="${staticPath }/css/jquery-weui.min.css"> <script type="text/javascript...

dawnStart的博客 3264

100天精通Python(可视化篇)——第109天:Pyecharts绘制各种常用地图(参数说明+代码实战)

100天精通Python(可视化篇)——第109天:Pyecharts绘制各种常用地图(参数说明+代码实战)

努力让自己发光,对的人才能迎着光而来 8万+

jquery weui 图片浏览器Photo Browser 如何调用?

https://www.cnblogs.com/zxyun/p/9493871.html

u012922417的专栏 146

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

jq weui 图片浏览器Photo Browser 第一次点击任意图片总是显示第一张

第一次做这个图片浏览器的时候遇到一个问题,如共有6张图片,每次进入页面时,第一次点击,无论去点击6张图片的哪一张初始化显示的都是第一张图片。后面的每次点击都没有问题的。 for(let i = 0;i<data.imgModelList.length;i++){ let s = data.imgModelList[i] ...

weixin_33845477的博客 465

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

微信公众号H5文中图片点击预览放大缩小、滑动效果实现(两种方式)

1、第一种直接使用微信js-sdk,jweixin-1.6.0.js var imgs = $("#preview").find("img"); var imgsSrc = new Array(); for(k = 0,len=imgs.length; k < len; k++) { imgsSrc[k] = $("#preview").find("img").eq(k).attr("src"); } $("img.fr").click(function () { wx.previewI

qq_37002521的博客 4856

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

weUI 上传图片

前端代码用的是weUI封装好的样式 <div class="weui-gallery" id="gallery"> <span class="weui-gallery__img" id="galleryImg"></span> <div class="weui-gallery__opr"> <a href="javascript:" class="weui-g...

zhaofuqiangmycomm的博客 883

微信公众号开发C#系列-12、微信前端开发利器:WeUI

1、前言 通过前面系列文章的学习与讲解,相信大家已经对微信的开发有了一个全新的认识。后端基本能够基于盛派的第三方sdk搞定大部分事宜,剩下的就是前端了。关于手机端的浏览器的兼容性问题相信一直是开发者们的一块心病,对于微信开发前端组件这一块总是找不到合适的移动端组件,什么都要自己去实现,这个开发成本就大了去了。于是乎博主打算另辟蹊径,找找基于微信开发的移动端UI组件,最后找到了微信官方开发的一套前端...

.NET快速开发框架 2683

SDPhotoBrowser 非常简单易用的图片浏览

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; [imageView addGestureRecognizer:singleTap]; UIView *singleT

thanklife的专栏 2633

MWPhotoBrowser 属性详解 和代理解释

MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];   //分享按钮,默认是   browser.displayActionButton = NO;   //底部是否分页切换导航,默认否   browser.displayNavArrows = NO;   ////是否显

hsf_study的博客 5124

巧用weui.gallery(),点击图片后预览图片

要在页面需要加载的JS文件: &lt;script src="../js/libs/weui.min.js"&gt;&lt;/script&gt; 可以去weui的文档中下载,这是它的demo:   https://weui.io/weui.js/   要先给图片创建一个节点: var imgDom = $("&lt;img class='weui-jiaj-img' /&gt;"); 因...

weixin_34240520的博客 1258

微信UI项目:jQuery WeUI

jQuery WeUI 是WeUI的一个jQuery实现版本,除了实现了官方插件之外,它还提供了如下拉刷新、日历、地址选择器等丰富的拓展组件。jQuery WeUI 中的JS组件均是以JQuery 插件的形式提供,使用非常方便,并且可以和React、Angular、VUE之类的主流JS框架一起使用。 WeUI 是微信官方团队针对微信提供的一个H5 UI库,它只提供了一组CSS组件。jQuer

小李专栏 2万+

weui实现多张图片上传,单个预览并删除

订单详情 header a.information { background: url(./images/information.png) no-repeat center center / 2em auto; right: 0; } 图片上传

weixin_39682289的博客 8636

WeUI微信小程序UI界面参考【图片过大,点击图片查看】

博客 2096

使用jQuery-ui预览图片

1、官网下载地址:http://jqueryui.com/download/ 2、引入文件,本地环境是laravel: 3、有一个容器,用来放图片: 4、函数处理: function showImg(name, path) { $('#showImg').attr("src", path); $('#showDetail').d

snow_small的博客 1346

gitHub上面photoBrowser的使用

附上链接:https://github.com/cuzv/PhotoBrowser 最近在做一个项目,里面有一个图片浏览,类似于新浪微博里面图片浏览的效果,后来在gitHub上面找到了一个框架,很好用,在gitHub里面,可以看到how to use 第一句话就是,这个图片浏览器类似于UITableView的API,要想使用这些个方法,还要遵循photoBrowser的两个代理,下面说  使用这

lausen34的博客 926
上一篇: 什么时候使用CountDownLatch
rmnjava
博客等级 码龄20年 8粉丝 5原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值