京东6.18大促主会场领京享红包更优惠

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 8310|回复: 0

jQuery实现朋友圈查看图片

[复制链接]

18

主题

0

回帖

10

积分

新手上路

积分
10
发表于 2020-9-18 19:29:10 | 显示全部楼层 |阅读模式 来自 中国
jQuery实现朋友圈查看图片效果,供大家参考,具体内容如下( P  e. C+ _0 W' T3 b1 C' S
效果: 图片点击显示大图,多张图可以滑动,左右按钮点击可切换查看图片 (左右点击切换效果不需要删除样式即可)6 i: b5 D- v% V# o% V  B, G# O

$ n4 f% R: Y" O7 W% Z0 `index.html 文件
  1.      jQuery模仿朋友圈查看图片效果                  
  2.   
复制代码
touchTouch.css 文件
0 D$ O+ x% S, t; l! {+ \9 ^, e预加载loading动图 preloader.gif1 R( W$ X* K( B. L! w9 N

' _" O9 y* U5 T5 P左右切换按钮图片 arrows.png(不需要可删除)" b3 v8 n& a  ~; r" B7 `: @: W! X
  1. #galleryOverlay{ width:100%; height:100%; position:fixed; top:0; left:0; opacity:0; z-index:100000; background-color:#222; background-color:rgba(0,0,0,1); overflow:hidden; display:none; -moz-transition:opacity 1s ease; -webkit-transition:opacity 1s ease; transition:opacity 1s ease;}#galleryOverlay.visible{ opacity:1;}#gallerySlider{ height:100%; left:0; top:0; width:100%; white-space: nowrap; position:absolute; -moz-transition:left 0.4s ease; -webkit-transition:left 0.4s ease; transition:left 0.4s ease;}#gallerySlider .placeholder{ /* preloader.gif 预加载loading动图 */ background: url("preloader.gif") no-repeat center center; height: 100%; line-height: 1px; text-align: center; width:100%; display:inline-block;}#gallerySlider .placeholder:before{ content: ""; display: inline-block; height: 50%; width: 1px; margin-right:-1px;}#gallerySlider .placeholder img{ display: inline-block; max-height: 100%; max-width: 100%; vertical-align: middle;}#gallerySlider.rightSpring{ -moz-animation: rightSpring 0.3s; -webkit-animation: rightSpring 0.3s;}#gallerySlider.leftSpring{ -moz-animation: leftSpring 0.3s; -webkit-animation: leftSpring 0.3s;}/* Firefox Keyframe Animations */@-moz-keyframes rightSpring{ 0%{ margin-left:0px; } 50%{ margin-left:-30px; } 100%{ margin-left:0px; }}@-moz-keyframes leftSpring{ 0%{ margin-left:0px; } 50%{ margin-left:30px; } 100%{ margin-left:0px; }}/* Safari and Chrome Keyframe Animations */@-webkit-keyframes rightSpring{ 0%{ margin-left:0px; } 50%{ margin-left:-30px; } 100%{ margin-left:0px; }}@-webkit-keyframes leftSpring{ 0%{ margin-left:0px; } 50%{ margin-left:30px; } 100%{ margin-left:0px; }}/* 左右切换按钮 *//* arrows.png 左右切换按钮图片 不需要可删除 */#prevArrow,#nextArrow{ border:none; text-decoration:none; background:url('arrows.png') no-repeat; opacity:1; cursor:pointer; position:absolute; width:43px; height:58px; top:50%; margin-top:-29px; -moz-transition:opacity 0.2s ease; -webkit-transition:opacity 0.2s ease; transition:opacity 0.2s ease;}#prevArrow:hover, #nextArrow:hover{ opacity:1;}#prevArrow{ background-position:left top; left:40px;}#nextArrow{ background-position:right top; right:40px;}/* 页码 */#pagelimit{ position:absolute; bottom:20px; left:50%; margin-left:-18px; color:#fff; font-size:1.4rem;}
复制代码

  }7 X9 j- d; i1 ?, s8 ~touchTouch.jquery.js 文件0 B8 N& u' ]' X$ Y: ]' i) Y' F. b4 x
[code](function(){ /* Private variables */ var overlay = $('<div id="galleryOverlay">'), slider = $('<div id="gallerySlider">'), prevArrow = $(''), nextArrow = $(''), pageSpan = $('<span id="pagelimit">

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

帖子地址: 

梦想之都-俊月星空 优酷自频道欢迎您 http://i.youku.com/zhaojun917
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|梦想之都-俊月星空 ( 粤ICP备18056059号 )|网站地图

GMT+8, 2025-12-19 18:37 , Processed in 0.041594 second(s), 24 queries .

Powered by Mxzdjyxk! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表