Change the background in a div with CSS

hello everybody,

i’m just trying to know this RoR better. And I have a question:

  • i have a
    in my scaffold.css and it has a background image. I
    actually have 5 background pictures and i’d like to use one of them
    randomly. Do I have to move this div description in another .rb file
    (where i can do the random pick with ruby?) or is there any other way?

    i hope it made sence.

    thanks for your help,
    iM

Javascript to change the style of this div “onload”? - S

imehesz wrote:

hello everybody,

i’m just trying to know this RoR better. And I have a question:

  • i have a
    in my scaffold.css and it has a background image. I
    actually have 5 background pictures and i’d like to use one of them
    randomly. Do I have to move this div description in another .rb file
    (where i can do the random pick with ruby?) or is there any other way?

    i hope it made sence.

    thanks for your help,
    iM

imehesz wrote:

hello everybody,

i’m just trying to know this RoR better. And I have a question:

  • i have a
    in my scaffold.css and it has a background image. I
    actually have 5 background pictures and i’d like to use one of them
    randomly. Do I have to move this div description in another .rb file
    (where i can do the random pick with ruby?) or is there any other way?

    i hope it made sence.

    thanks for your help,
    iM

    Every time you relaod the page “rand(5)” will yeild a different number
    from 0 - 4, resulting in a random displayed image.

thank you it helped!

iM

Every time you relaod the page “rand(5)” will yeild a different number
from 0 - 4, resulting in a random displayed image.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs