产品图像中的图像缩略图
Image thumbnail in product images
你好,我正在开发一个网页,我想向客户展示我的产品,有点像这个
http://store.americanapparel.net/french-terry-s-s-kangaroo-pullover-hoody_fs424
我希望我的图像被显示出来,产品图像的所有其他变体都被显示在更大的图像下,以及所有的效果。有人能告诉我如何做到这一点吗?感谢
我会这样做:
AngularJs
var demo = angular.module('demo', []);
demo.controller('demoCtrl', function($scope) {
$scope.imgs = {};
$scope.imgs.a = {
'small': 'http://placehold.it/150x150/000000',
'large': 'http://placehold.it/500x500/000000'
};
$scope.imgs.b = {
'small': 'http://placehold.it/150x150/cccccc',
'large': 'http://placehold.it/500x500/cccccc'
};
$scope.imgs.c = {
'small': 'http://placehold.it/150x150/ffffff',
'large': 'http://placehold.it/500x500/ffffff'
};
$scope.viewShowing = $scope.imgs.a.large;
$scope.applyNewLargeView = function(largeViewUriString){
$scope.viewShowing = largeViewUriString;
}
});
CSS
* {
padding: 0;
margin: 0;
}
.container {
width: 500px;
}
.main,
.sub {
display: block
}
.main > img {
width: 100%;
}
.sub > img {
width: 33%;
}
翡翠标记
main(ng-app="demo", ng-controller="demoCtrl", class="container")
.main
img(ng-src="{{ viewShowing }} ")
.sub
img(ng-repeat="img in imgs", ng-click="applyNewLargeView(img.large)" ng-src="{{ img.small}}")
这是成品:
http://codepen.io/nicholasabrams/pen/MwOMNR
相关文章:
- 当页面包含指向一个图像的多个链接时,fancyBox会复制缩略图辅助图像
- 用较大的图像交换缩略图
- 不应选择缩略图优先图像
- 为缩略图库和较大图像库添加下一个和上一个按钮
- 缩略图图像滑块
- 图像缩略图库中的“下一个”和“上一个”按钮中的“问题”
- 图像库缩略图滑块
- 缩略图库的XML数据图像绑定
- 在缩略图库中显示图像
- 缩略图单击时图像未以模式显示
- JS照片库.使大图像显示和缩略图可单击
- 尝试显示使用 php 和数据库检索的缩略图中的全尺寸图像
- 如何使用jQuery单击其缩略图时显示主图像
- JS-点击缩略图将显示正确的图像
- 动态加载的缩略图显示其他缩略图的全尺寸图像,而不是自己的缩略图(使用javascript悬停效果)
- ExtJS FormPanel,文件上传旁边有图像缩略图
- 显示从文件选择器中选择的图像的图像缩略图
- Jquery缩略图库正在更改所有图像
- 基于缩略图在路径中循环浏览图像
- 如何使用javascript在缩略图中移动多个图像(从phpmyadmin检索)