Re: Re: Newbie - Rails 3 lightbox?

Walter Lee Davis
Fri, 15 Oct 2010 16:13:41 -0000

Oh, try linking to the full size image. Here''s how the rendered HTML
works in one of my pages:

<a href="path/to/full_size_image.jpg"
class="lightwindow"><img
src="path/to/thumbnail_image.jpg" width="123"
height="123" alt="foo" /
>

Walter

On Oct 15, 2010, at 11:58 AM, Anders_P wrote:

> Hi!
>
> Thanks for your quick answer. I''ve tried:
>
>
>  <a href="<%= ad.image.url(:thumb) %>"
class="lightbox"><img src="<%> ad.image.url(:thumb)
%>" />
>
>
> But that didn''t work either. It links to the image but not with a
> popup effect. It just redirects to the image url and shows a page with
> the image. So the popup effect doesn''t work.
> Any other tips?
>
> // Anders
>
>
> On 15 Okt, 17:29, Walter Lee Davis
<wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:
>> I think Lightbox2 uses the classname rather than the rel for the
>> initial hook. Rel is used for a lot of other stuff like geometry and
>> format, but classname does the initial hookup.
>>
>> Walter
>>
>> On Oct 15, 2010, at 11:24 AM, Anders_P wrote:
>>
>>
>>
>>> Hello!
>>
>>> I''m trying to create a simple image "popup"
effect using Lightbox2,
>>> http://www.huddletogether.com/projects/lightbox2/. But I
don''t get
>>> it
>>> to work. My code looks lite this:
>>
>>>
>>>  <a href="<%= ad.image.url(:thumb) %>"
rel="lightbox"><img src="<%>>>
ad.image.url(:thumb) %>" />
>>>
>>
>>> This generates:
>>
>>>
>>>  <a href="/system/images/301/thumb/tufftroja_19225958.jpg?
>>> 1287075644"
>>> rel="lightbox"><img
src="/system/images/301/thumb/
>>> tufftroja_19225958.jpg?
>>> 1287075644" />
>>>
>>
>>> And in my application.html.erb
>>
>>> <%= render ''layouts/stylesheets'' %>
>>> <%= stylesheet_link_tag ''lightbox'' %>
>>> <%= javascript_include_tag :defaults,
''lightbox'' %>
>>
>>> The image shows up, but nothing happens when I click on it.
>>
>>> Any suggestions on what I''m doing wrong would be
appreciated!
>>
>>> Thanks!
>>> // Anders
>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ruby on Rails: Talk" group.
>>> To post to this group, send email to rubyonrails-
>>> talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>> .
>>> For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en
>>> .
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-
> talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> .
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
> .