Question

I am still new to HTML/CSS/JavaScript so I am not sure of what can and can not be done. I am trying to use the clip property to reveal a div over time. Is this possible and if so how? I can only seem to access clip in JavaScript using quotations (ex. element.style.clip = "rect(x, x, x, x)".

I would like to have it read element.style.clip = "rect(x, x, scalerValuepx, x)".

Any help would be great.

Thank you.

Was it helpful?

Solution

Without knowing much about your intended use of clip on a div, I would probably recommend giving the div in question overflow-y: hidden with CSS and gradually increasing the CSS height of the element until it is fully revealed.

There's some really easy to use animation methods in jQuery that do this, such as slideDown().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top