treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Js Background slider behind content

  • Hello.

    I am just working with a new idea that I have got but don't know how to make the background slider go behind content. I already have a body with fixed image. just would like the script to go on top of current body but behind content http://codepen.io/mwbcomputers/pen/nELim

    Is there some way i can add styles with z-index in the Java Script I am not to sure how to add it? or where it goes.

  • I'm not sure what I'm looking at with that codepen...

    With jQuery it's easy to add z-index though: $('img').css('z-index', -1);

  • Sliding Images behind content is a poor UX/UI idea....IMO

    Quite possibly you will render your content unreadable.

  • I know this is going to sound wacky (and I have no idea if it will work) BUT,,,

    ...could you add the existing body background image to the [html] element and the apply the rotating/sliding bg image to the body?

    Can you do that?

    Obviously, you would need JS/JQ to swap out the body background but it shouldn't be impossible...should it?