Created
May 11, 2012 17:08
-
-
Save latortuga/2661060 to your computer and use it in GitHub Desktop.
gallery hover effects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d; | |
| } | |
| .gallery-slideshow-caption { | |
| width:300px; | |
| height:298px; | |
| float: right; | |
| left:880px; | |
| color:#fff; | |
| background: $red; | |
| z-index:500; | |
| opacity: 0.4; | |
| } | |
| .gallery-slideshow-caption .slideshow-caption-container { | |
| padding:5px 10px; | |
| z-index:1000; | |
| } | |
| .gallery-slideshow-caption h3 { | |
| margin:0; | |
| padding-top:10px; | |
| font-size:18px; | |
| color: #fff; | |
| line-height: 105%; | |
| } | |
| .gallery-slideshow-caption p { | |
| margin:5px 0 0 0; | |
| padding-top:10px; | |
| font-size:14px; | |
| font-weight: bold; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SlideGallery | |
| $(function() { | |
| $("a.slide_gallery").hover(function() { | |
| var image = $(this).attr("rel"); | |
| var title = $(this).attr("title"); | |
| var desc = $(this).attr("alt"); | |
| $('#slide_gallery').fadeIn('fast'); | |
| $('#slide_gallery img').attr('src', image) | |
| $('#slide_gallery img').attr('alt', title) | |
| $('#slide_gallery img').attr('title', desc) | |
| $('#slide_gallery div h3').html($(this).attr('title')); | |
| $('#slide_gallery div p').html($(this).attr('alt')); | |
| // make the caption appear | |
| $('#slide_gallery div.gallery-slideshow-caption').fade("slow") | |
| return false; | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= image_tag(@first_image.image_url(:slide_gallery)) %> | |
| <div class="gallery-slideshow-caption"> | |
| <div class="slideshow-caption-container"> | |
| <h3><%= @first_image.name %></h3> | |
| <p><%= @first_image.description %></p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="slide_gallery"> | |
| <ul> | |
| <% @images.each do |image| %> | |
| <li> | |
| <a href="javascript:void(0)" rel="<%= image.image_url(:slide_gallery) %>" class="slide_gallery" title="<%= image.name %>" alt="<%= truncate(image.description, :length => 300) %>"> | |
| <%= image_tag(image.image_url(:thumb)) %> | |
| </a> | |
| </li> | |
| <% end %> | |
| </ul> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment