Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery with slideshow in Ruby On Rails
    primarykey
    data
    text
    <p>I am trying to make a slideshow with jQuery. <strong>I have the photos in an array</strong> but I don't know how to create the slideshow. I've taken a look at '<a href="http://jquery.malsup.com/cycle/" rel="nofollow">http://jquery.malsup.com/cycle/</a>' but I have no idea what to do.</p> <p>and in views>layouts>application</p> <pre><code> &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#shuffle').cycle({ fx: 'shuffle', delay: -4000 }); }); </code></pre> <p><strong>to view the photos I have this (but this shows me all the photos at once):</strong></p> <pre><code> &lt;div id="shuffle"&gt; &lt;% @building.building_photos.each do |photo| %&gt; &lt;%= link_to (image_tag (photo.photo.url)), @building %&gt; &lt;% end %&gt; &lt;/div&gt; </code></pre> <p>UPDATE 1(source code)</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Welcome to koshbay&lt;/title&gt; &lt;link href="/assets/all.css" media="screen" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/about.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/addphotos.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/admin.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/buildings.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/contact.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/forrent.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/forsale.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/projectproperties.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/rended.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/rented.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/seeits.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/sessions.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/sold.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/soon.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/store.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;link href="/assets/users.css?body=1" media="all" rel="stylesheet" type="text/css" /&gt; &lt;script src="/assets/application.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/jquery.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/jquery-ui.js?body=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/assets/jrails.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#shuffle').cycle({ fx: 'shuffle', easing: 'easeOutBack', delay: -4000 }); }); &lt;/script&gt; &lt;meta content="authenticity_token" name="csrf-param" /&gt; &lt;meta content="hCMHawSL0iZidEaHMt8D7T1YhYAuwpzXCdvtwyHxiC0=" name="csrf-token" /&gt; &lt;/head&gt; &lt;body id="store" &gt; &lt;div id="banner" &gt; &lt;img alt="Welcome" src="/assets/welcome.jpg" /&gt; Welcome to KTIMABAY &lt;/div&gt; &lt;div id="side" &gt; &lt;a href="/"&gt;Home&lt;/a&gt; &lt;br/&gt; &lt;a href="http://www..../faq" &gt;Questions&lt;/a&gt;&lt;br /&gt; &lt;a href="/about/index"&gt;About&lt;/a&gt;&lt;br/&gt; &lt;a href="/contact/index"&gt;Contact&lt;/a&gt; &lt;br/&gt; &lt;a href="/sessions/new"&gt;Login&lt;/a&gt; &lt;br/&gt; &lt;br /&gt; &lt;/div&gt; &lt;div id="main" &gt; &lt;p id="notice"&gt;&lt;/p&gt; &lt;p&gt; &lt;div id="shuffle"&gt; &lt;a href="/buildings/27"&gt;&lt;img alt="House-exterior-design-wallpaper-actrists-bollywood" src="/system/building_photos/photos/000/000/017/original/House-exterior-design-wallpaper-actrists-bollywood.jpg?1363274173" /&gt;&lt;/a&gt; &lt;a href="/buildings/27"&gt;&lt;img alt="House-interior-design-8" src="/system/building_photos/photos/000/000/018/original/House-Interior-Design-8.jpg?1363274173" /&gt;&lt;/a&gt; &lt;a href="/buildings/27"&gt;&lt;img alt="Jesse-james-home-bad-feng-shui-bedroom" src="/system/building_photos/photos/000/000/019/original/jesse-james-home-bad-feng-shui-bedroom.jpg?1363274173" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;p&gt; &lt;b&gt;Title:&lt;/b&gt; lefkeri &lt;/p&gt; &lt;p&gt; &lt;b&gt;Status:&lt;/b&gt; For Rent &lt;/p&gt; &lt;p&gt; &lt;b&gt;Description:&lt;/b&gt; 2 bedrooms &lt;/p&gt; &lt;p&gt; &lt;b&gt;Price:&lt;/b&gt; € 500.0 &lt;/p&gt; &lt;form action="/seeits/27?building_id=27" class="button_to" method="post"&gt;&lt;div&gt;&lt;input type="submit" value="I want to see it" /&gt;&lt;input name="authenticity_token" type="hidden" value="hCMHawSL0iZidEaHMt8D7T1YhYAuwpzXCdvtwyHxiC0=" /&gt;&lt;/div&gt;&lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Any ideas as to how I could do this (first time I have to use jQuery and for this reason I don't know how to do it)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload