Hi again :)
I'm new to prototype, javascript and I got many problems
so please understand my bunch of questions :)
Here is my question.
I'd like to replace my div when window resized.
I coded like below:
<script>
function onBodyLoad() {
var onResize = function(e) {
var viewport = document.viewport.getDimensions();
var screen = $('screen');
var s_view = screen.getDimensions();
screen.style.positon = 'absolute';
screen.style.left = (viewport.width - s_view.width)/2+'px';
screen.style.top = (viewport.height - s_view.height)/2+'px';
};
Element.observe(window, 'resize', onResize);
};
</script>
<body onLoad="new onBodyLoad()">
I can see onResize was called.
But IE, viewport.width returns 0, and FF returns right number.
and both screen element doesn't move its position.
What's wrong with above code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---