Tag: 照片

使用jQuery幻灯片显示文件夹中的图像

我的Jquery幻灯片脚本看起来像那样 $(function() { $(‘#bg’).crossSlide({ sleep: 3, shuffle: true, fade: 1 }, [ { src: ‘core/design/images/bgs/1.jpg’}, { src: ‘core/design/images/bgs/2.jpg’}, { src: ‘core/design/images/bgs/3.jpg’}, { src: ‘core/design/images/bgs/4.jpg’} ]) }); 如你所见,我逐一宣布了图像的路径。 有没有办法扫描文件夹的图像并一次添加所有。 也许,它可以用PHP完成?

使用Paperclip在ror中多次上传

我正在使用回形针为一栋建筑上传一张照片。 http://www.youtube.com/watch?v=KGmsaXhIdjc我用这种方式完成了它。 但我知道我决定将许多照片上传到一栋建筑物。 我可以用回形针做到这一点,还是必须改变它并使用jQuery? 如果我能怎么样? Ps:如果需要,我会上传我的代码。 ps:我想在照片2和照片3的数据库中再制作2列 。顺便说一下,我看到所有产生的资产都是为了做到这一点。 我认为我用不同的方式上传1张照片。 这意味着我必须改变一切吗? 更新1: 在routes.rb中 resources :buildings do resources :photos end 在buldings> _form {:multipart => true}) do |f| %> prohibited this building from being saved: ‘Select status of the building’ %> 10 %> <!– –> 在模型>建筑 attr_accessible :description, :price, :status, :title, :photo accepts_nested_attributes_for :photo, :allow_destroy => true has_attached_file […]