2012-05-03 10 views
0

イメージとテキストが動的になる簡単なjQueryスライドショーで作業しようとしています。jQuery + Rails 3.1でのダイナミックスライドショー

Railsのコードは次のようである:

.section 
    [email protected] do |testimonial| 
     .section 
      .row.testimonial.round 
       .three.columns 
        =image_tag(testimonial.testifier.thumb_small.url)   
       .eight.columns.testimonial-description 
        .row.testimonial-description 
         %blockquote 
          %span(class = "bqstart") &#8220 
          =testimonial.description 
          %span(class = "bqend") &#8221 
        .row.testifier-details 
         %strong="#{testimonial.name} #{testimonial.designation} #{testimonial.company}" 
       .one.columns 

これは私のデータベースからのイメージと説明を行います。

これらの結果をスライドショーに入れたい場合、どうすればいいですか?

答えて

0

このことは、Zurb Orbit(スライドショー)ではうまく機能しませんでした。私はより良いスライドショーIMOであるslide.jsに切り替えた。 ass/assets/javascriptこの中でslides.jsをインストールした後

は、スライドショーのHTMLです: -

.section 
    #testimonial-slideshow.round 
     [email protected] do |testimonial| 
      .row 
       .three.columns 
        =image_tag(testimonial.testifier.thumb_small.url)   
       .nine.columns 
        .row.testimonial-description 

         %span(class = "bqstart") &#8220 
         =truncate(testimonial.description, :length => 150) 
         %span(class = "bqend") &#8221 
        .row.testimonial-name 
         %strong="#{testimonial.name} #{testimonial.designation} #{testimonial.company}" 

とjsが次のようになります -

$('#testimonial-slideshow').slides({ 
      width: 600, 
      height: 120, 
      generateNextPrev: false, 
      pagination: false, 
      play: 1000 
    });