Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Background fade effect (javascript/jQuery)  (Read 4213 times)

0 Members and 1 Guest are viewing this topic.

rents

  • Guest
Background fade effect (javascript/jQuery)
« on: June 06, 2011, 10:03:28 AM »
Hey everyone.

I'm looking to replicate an effect I saw on an app used on an iPad.

Basically, there's a background image and a layered, centered content section. As you scroll down, the opacity of the background starts to fade, without effecting the content section at all. By the time you scroll to the footer, the opacity is at around 10% or so.

Anyone know if this is possible using Jquery or can point me in the right direction?

Thanks for your time.

feras



    Beginner

    Thanked: 1
  • Experience: Experienced
  • OS: Linux variant
Re: Background fade effect (javascript/jQuery)
« Reply #1 on: June 13, 2011, 04:21:13 AM »
Hello

to make this, you should separates between the div of the background and the other one which holds the content by setting their position to absolute and apply a z-index CSS property to make the content above the background.

I don't know how do iPad apps looking but I think that if you want that div to fade on scroll, you should get the height of the background div, and use the onscroll event to check how long the distance that user have scrolled to calculate the new fade value

I hope I could do fine :)

regards
« Last Edit: June 13, 2011, 04:32:01 AM by feras »

Vidya123



    Greenhorn

  • Experience: Beginner
  • OS: Unknown
Re: Background fade effect (javascript/jQuery)
« Reply #2 on: July 10, 2011, 03:13:37 AM »
Query is being used by more and more web designers nowadays to create simple animation in web pages. One of the most commonly used effect is the fade in/out effect which is used in image slideshows, button hovers, page loads and more.


Don't copy/paste content from other sites without recognition


See here: http://medienfreunde.com/lab/innerfade/

--kpac
« Last Edit: July 11, 2011, 07:31:33 AM by kpac »
Promote your hair growth with
argan oil