Ruby on Rails Tuesday, May 31, 2011

On May 31, 2011, at 6:22 PM, Jedrin wrote:

> I have a section of controller code that tries to style a page with
> moving text and images.
> This used to work a few years ago, but I have not had the site working
> for awhile and I am trying to resurrect it.
> Below is some of the RJS code. The z-index and font-size does not seem
> to work as far as I can tell, though I am especially focused on z-
> index not working. My moving text is supposed to be in front of the
> images, but it is not.
> If I do view generated source from web developer plugin, one of the
> elements generated is shown below. I am not sure if my problem may be
> something different in RJS or CSS is needed or what else I can try to
> troubleshoot the problem ? I am using rails 3.0.5 at the moment ..
> thanks
>
>
> page[k].set_style :'font-size' => font_sz
> page[k].set_style :color => col
> page[k].set_style :position => 'absolute'
> page[k].set_style :left => 40 + (horz)
> horz = horz + spacing + (w.length * mult)
> page[k].set_style :top => (tidx * 100) + 70
> page[k].set_style :'z-index' => 20
> page[k].visual_effect effect, {:queue=> {:position =>
> 'end', :scope => scope}, :duration => 1}
>
> some of the dynamic css generated:
>
> <span id="sp0_0" style="color: purple; position: absolute; left: 40px;
> top: 70px; overflow: visible;">Free</span>

Which suggests that :'z-index' is being ignored. Are you sure that's
the way to set this property (quoted symbol name)? Have you
tried :z_index instead? (I have no idea, that's just a guess.) In
vanilla JavaScript, any of the attributes that have dashes in their
name get interCapped, but that doesn't seem like it would work on the
Ruby side of things.

Walter

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment