elreteipos
asked on
Closing a DIV slowly
Hello,
When you first visit Yahoo.com using Firefox, you see a message at the top of the page telling you how you can choose Yahoo! as your default search engine in Firefox. When you click the close button, that message slowly closes.
Screenshot: http://img119.imageshack.us/img119/1979/yahoo2mp.jpg
I have something similar too on my blog. When you visit the site with IE, you'll see a message that pushes you to install Firefox. I want people to be able to close the message using a script that closes the message very slowly, like the Yahoo! message does. How can I make that happen?
Blog website: http://theofftopicblog.blogspot.com
Screenshot: http://img157.imageshack.us/img157/9498/blog7yd.jpg
Thanks in advance,
Pieter
When you first visit Yahoo.com using Firefox, you see a message at the top of the page telling you how you can choose Yahoo! as your default search engine in Firefox. When you click the close button, that message slowly closes.
Screenshot: http://img119.imageshack.us/img119/1979/yahoo2mp.jpg
I have something similar too on my blog. When you visit the site with IE, you'll see a message that pushes you to install Firefox. I want people to be able to close the message using a script that closes the message very slowly, like the Yahoo! message does. How can I make that happen?
Blog website: http://theofftopicblog.blogspot.com
Screenshot: http://img157.imageshack.us/img157/9498/blog7yd.jpg
Thanks in advance,
Pieter
ASKER
What is the right "JavaScript path" to the height of a DIV? I tried document.getElementById('h asIE_level 1').style. height and document.getElementById('h asIE_level 1').height but that doesn't work.
document.getElementById('h asIE_level 1').client Height
document.getElementById('h asIE_level 1').offset Height
document.getElementById('h asIE_level 1').scroll Height
either one
document.getElementById('h
document.getElementById('h
either one
ASKER
I used this code:
<script language="JavaScript">
setTimeout("reduce()", 10000);
function reduce() {
var heightIEpop = document.getElementById('h asIE_level 1').offset Height;
while (heightIEpop != 0) {
heightIEpop--;
document.getElementById('h asIE_level 1').offset Height = heightIEpop;
setTimeout("", 500)
}
}
</script>
But it's not working. By debugging the code, I found out that document.getElementById('h asIE_level 1').offset Height = heightIEpop; might causing problems. Is this the error? How do I fix this?
<script language="JavaScript">
setTimeout("reduce()", 10000);
function reduce() {
var heightIEpop = document.getElementById('h
while (heightIEpop != 0) {
heightIEpop--;
document.getElementById('h
setTimeout("", 500)
}
}
</script>
But it's not working. By debugging the code, I found out that document.getElementById('h
ASKER
Hello? Anybody? :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Does it work on a Blogger.com blog? (that's the place where I want to use it)
ASKER
Edit: it's working now. I will upload it to the server tomorrow. Thank you, pedershk. Also, thanks to KennyTM for learning me something new. :)
function reduce() {
if lines remain
Decrease size of displayed section by 1 line,
Delay for 1/2 or 3/4 of a second - and execute function again
}