- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我现在正在开发一个与 Facebook 相册非常相似的相册。
我将显示所有包含特定相册的大量特定图像的相册。
我已经创建了布局。
这是我的布局。
当用户点击相册时,它会打开 Bootstrap Modal 并显示属于该文章的那些图像。
但是现在我面临一个问题,打开Modal后,它显示了属于其他相册的所有图像。有什么方法可以限制吗?
顺便说一下,我正在使用 Bootstrap Image Gallery .
非常感谢。
最佳答案
只需更改所有路径和变量,如图像等。
索引.js
var i, expand = false;
function reset() {
$('.deck').css({
'transform': 'rotate(0deg)',
'top' : '0px'
});
}
//expands and contracts deck on click
$('.deck').click(function (a) {
if (expand) {
a.preventDefault();
var imgSource = $(this).children().attr('href');
$('#lightwrap').append('<img src="' + imgSource + '" id="lb-pic">');
$('#lightbox, #lightwrap').fadeIn('slow');
} else {
var boxWidth = $('.deck').width();
$('.deck').each(function (e) {
$(this).css({
'left': boxWidth * e * 1.1 + 'px'
});
expand = true;
$('#close').show();
});
}
});
//close lightbox
$('#x, #lightbox').click(function(){
$('#lightbox').fadeOut('slow');
$('#lightwrap').hide();
$('#lb-pic').remove();
$('.deck').css({'left': '0px'});
expand = false;
});
//prevent event bubbling on lightbox child
$('#lightwrap').click(function(b) {
b.stopPropagation();
});
$('#close').click(function(){
$(this).hide();
$('.deck').css({'left': '0px'});
expand = false;
});
$('.deck:last-child').hover(
//random image rotation
function() {
if (expand === false) {
$('.deck').each(function () {
i++;
if (i < $('.deck').length) {
var min = -30,
max = 30,
random = ~~(Math.random() * (max - min + 1)) + min;
$(this).css({
'transform' : 'rotate(' + random + 'deg)',
'top' : random + 15 + 'px'
});
}
});
}
//straightens out deck images when clicked
$('.deck').click(
function (a) {
a.preventDefault();
reset();
});
},
//undo image rotation when not hovered
function () {
i = 0;
reset();
}
);
style.css 如果你想要什么设计,你可以编辑你的 css。
*, *::before, *::after {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGElEQVQIW2NkwAIYCQn+ByoAKyKoEm4SADSgAQYZyK9gAAAAAElFTkSuQmCC);
}
h1, p {
text-align: center;
}
h1 {
font-family: 'Lobster';
font-size: 90px;
margin: 20px 0 0;
text-shadow: 2px 2px 0 #fff, 3px 3px 0 #000;
}
p {
font-family: arial, helvetica, sans-serif;
font-size: 24px;
color: #6CBDEB;
text-shadow: 1px 1px 1px #000;
}
.wrap {
position: relative;
width: 1125px;
height: 200px;
margin: 0 auto;
}
.deck {
margin: 20px;
border: 1px solid black;
height: 202px;
width: 202px;
position: absolute;
top: 0;
left: 0;
transition: .3s;
cursor: pointer;
font-size: 50px;
line-height:200px;
text-align: center;
font-family: 'Londrina Shadow';
}
.deck a {
color: black;
}
.deck img {
height: 200px;
width: 200px;
}
.album {
border: 1px solid black;
height: 200px;
width: 200px;
float: left;
transition: .3s;
position: relative;
}
#close {
position: relative;
display: none;
width: 1125px;
margin: 30px auto 0;
}
#close p {
cursor: pointer;
text-align: right;
margin: 0 20px 0;
}
#lightbox {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.7);
display: none;
z-index: 999;
}
#lightwrap {
position: relative;
margin: 0 auto;
border: 5px solid black;
top: 15%;
display: table;
}
#lightwrap img {
display: table-cell;
max-width: 600px;
}
#x {
position: absolute;
top: 2px;
right: 2px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAAPFBMVEX///8AAAD9/f2CgoKAgIAAAAAAAAAAAABLS0sAAAAAAACqqqqqqqq6urpKSkpISEgAAAC7u7u5ubn////zbsMcAAAAE3RSTlMASv6rqwAWS5YMC7/AyZWVFcrJCYaKfAAAAHhJREFUeF590kkOgCAQRFEaFVGc+/53FYmbz6JqBbyQMFSYuoQuV+iTflnstI7ssLXRvMWRaEMs84e2uVckuZe6knL0hiSPObXhj6ChzoEkIolIIpKIO4joICAIeDd7QGIfCCjOKe9HEk8mnxpIAup/F31RPZP9fAG3IAyBSJe0igAAAABJRU5ErkJggg==);
width: 27px;
height: 27px;
cursor: pointer;
}
规范化.css
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
最后是 index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Image Gallery - CodePen</title>
<link href='http://fonts.googleapis.com/css?family=Londrina+Shadow|Lobster' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />
</head>
<body>
<h1>Image Gallery</h1>
<p>(click on the box to expand)</p>
<div class="wrap">
<div id="picture1" class="deck">
<a href="http://distilleryimage3.ak.instagram.com/a1319688e68e11e29dc322000a1f9c8f_7.jpg">
<img src="http://distilleryimage3.ak.instagram.com/a1319688e68e11e29dc322000a1f9c8f_7.jpg">
</a>
</div>
<div id="picture2" class="deck">
<a href="http://distilleryimage0.ak.instagram.com/5d2bfa90e77511e289a722000a9e28d6_7.jpg">
<img src="http://distilleryimage0.ak.instagram.com/5d2bfa90e77511e289a722000a9e28d6_7.jpg">
</a></div>
<div id="picture3" class="deck">
<a href="http://distilleryimage9.ak.instagram.com/83588b86ce2811e2bb5822000a9e060e_7.jpg">
<img src="http://distilleryimage9.ak.instagram.com/83588b86ce2811e2bb5822000a9e060e_7.jpg">
</a></div>
<div id="picture4" class="deck">
<a href="http://distilleryimage3.ak.instagram.com/f6838f7ef21911e2b61322000a1f9358_7.jpg">
<img src="http://distilleryimage3.ak.instagram.com/f6838f7ef21911e2b61322000a1f9358_7.jpg">
</a></div>
<div id="picture5" class="deck">
<a href="http://distilleryimage7.ak.instagram.com/89d4b8b4f70811e2b2fd22000a9e0875_7.jpg">
<img src="http://distilleryimage7.ak.instagram.com/89d4b8b4f70811e2b2fd22000a9e0875_7.jpg">
</a></div>
</div>
<div id="lightbox">
<div id="lightwrap">
<div id="x"></div>
</div>
</div>
<div id="close"><p>« collapse</p></div>
<script src='http://codepen.io/assets/libs/fullpage/jquery.js'></script>
<script src="js/index.js"></script>
</body>
</html>
就这些了..希望对你有很大帮助/hoooo :o
关于jquery - Bootstrap Image Gallery - 根据相册显示图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24380122/
这就是我现在拥有的,它适用于单个图像。 curl -vH "Authorization: Client-ID 3e7a4deb7ac67da" -F image=@/path/to/image htt
我有一套 PDF 相册模板(它们在文本和照片应该放置的地方有空白方 block )。我的需求是使用这些模板来生成实际的相册。 我的计划是使用 iText 和 Java。我会向应用程序发送一组要使用的所
我有一个包含多个字段的表单,用户需要通过附加图像数量的选项来感受: '; $num++; } ?> 提交后,它会在数据库中创建一个名为“album”的表,如下所示: fun
我创建了一个 Facebook 相册并拥有相册 ID。我可以使用/photos API 将照片上传到相册。但我无法使用类似/videos API 的方式上传视频。我收到错误消息: “(#200)用户没
我的代码是这样的: oldPicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTy
我正在实现一个 iPhone 应用程序,我必须从 Facebook 相册中检索图像并将这些照片显示为应用程序中的图库。我有这个链接 http://www.facebook.com/media/set/
我可以通过将数据发布到 使用 facebook graph api 创建相册 http://graph.facebook.com/ALBUM_ID/albums 它返回一个 id,这不是相册 id。
我是 Swift 的新手,我正在尝试使用 fetchAssetCollections 创建一个简单地返回屏幕截图相册中照片数量的函数 我有 func getNumScreenshots() -> In
我在使用权限上传到特定 Facebook 相册时遇到问题。 我被设置为特定 Facebook 页面的管理员,但是每当我尝试上传照片时,我似乎无法获得执行此操作的权限。 我得到的错误是: Fatal e
对于相册,我看到大多数人使用 3 个表: 专辑相片相册。 但是,如果我查看像 facebook 这样的网站,这个模式将不起作用(如果我理解正确的话),因为我的个人资料相册和一般相册中可能有一张照片,但
我正在编写一个程序来在本地备份我的 Google 相册库,上周代码运行良好,但在过去的几天里,我反复从 API 客户端收到错误消息,说“photoslibrary v1”不存在在 Google 的 A
似乎大多数方法都指向UIImageWriteToSavedPhotosAlbum(),但是在iOS 6及更高版本中,您需要用户权限才能写入相机胶卷,因此,如果他们说“no”,我希望能够调用代码。 是否
我想用Java制作简单的相册。要做到这一点,我认为这将是使用网格布局协调图片的最简单方法。 我有图片的缓冲图像,我正在尝试使用以下代码将它们添加到网格布局中, BufferedImage a
我正在制作一个数据采集应用程序,它可以让医生拍摄皮肤病的照片以供以后用于人工智能/机器学习目的,所以我的应用程序将有一个拍照按钮来拍照,假设有 4 个标签或按钮命名疾病(水痘,湿疹等)一旦用户拍照,他
我有一个 nodejs (+express + mongodb,gridstore) 后端,想上传一张照片到 facebook 相册。 我遇到了两种方法。第一个 ( https://developer
我正在尝试使用 Google Photos API增量上传一个非常大的本地照片库。 一切正常,但在上传大约 1.2GB 后,请求开始被拒绝并显示以下消息: Insufficient tokens fo
从youtube到google +很容易。但另一方面 我有一个Google Plus个人资料和与其链接的YouTube channel 。但是-从youtube-我看不到我的google +相册中的视
我正在尝试在 iPhone 应用程序中获取 facebook 用户的任何专辑。 这是我正在使用的 fql 查询 NSString *query = [NSString stringWithFormat
我正在尝试利用 Google Photos 幻灯片构建一个由 Raspberry Pi 驱动的数字相册。理想情况下,我希望能够通过 Selenium 自动化登录过程,然后使用 BeautifulSou
我正在尝试使用 Picasa Web Albums API 重构 Java 应用程序使用新的 Google 相册 API。 在 Picasa API 中,您有 PhotoEntry 对象,它代表上传的
我是一名优秀的程序员,十分优秀!