JS Animated. 如何改变相机滑块尺寸
March 3, 2014
本教程将向您展示如何进行更改 slider 图像尺寸 Website template.
JS Animated. 如何改变相机滑块尺寸Go to the /images/ 文件夹并替换其中一个 slider 带有new的图像 slider 具有不同维度的图像. 例如,如果原始的 slider 图像叫做幻灯片.如果是Jpg格式,则需要将其替换为新幻灯片.jpg file. Or, if your new slider 图像被称为slide3.Jpg格式,只需将其插入图像文件夹中,并在 html code.
If you open the index.html file in your web browser,您将看到图像被替换,但看起来有些拉伸.
要解决这个问题,您需要找出新的图像尺寸是什么. E.g. 1200 X 600像素.
Using the Firebug plugin 对于Firefox,请查找
如下所示(div id可能因模板号而异):它有以下的风格 /网站/ css /相机.css:
.camera_wrap { display: none; margin-bottom: 0 !important; 可见溢出: !important; 位置:相对; z-index: 0; }
向该类添加一个新属性 selector like width: 1200px ! important; (其中1200px是新建的宽度 slider image). 这将防止你的形象看起来拉伸.
在同一个类中再添加一个属性 selector like margin: 0 auto; 为了让你的形象居中.
现在需要复制编辑过的类 selector 从Firebug中替换原来的文件:
.camera_wrap { display: none; margin: 0 auto; 可见溢出: !important; 位置:相对; width: 1200px !important; z-index: 0; }
将所做的更改保存到 camera.css file.
Open the index.html 文件中有 slider adobedreamweaver中的代码或任何代码 editor. 寻找初始化 slider script 两者之间 tags:
$(document).准备好(函数(){ jQuery(“# camera_wrap”).camera({ loader: false, 分页:true; minHeight:“250”, 缩略图:假的, height: '42.6%', caption: false, 导航:假的, fx: 'mosaic' }); $().UItoTop({easingType: 'easeOutQuart'}); })
因为你的新图像的宽度是1200px,高度是600px, 新的百分比应该是50% (600/1200*100=50). 改变高度:' 42.将高度改为“50%”,并保存更改.
Your slider 图像现在应该显示其尺寸更改.
请随时查看下面的详细视频教程:
JS Animated. 如何改变相机滑块尺寸