I've stumbled upon 2 Javascript issues when making a small pop-up function. The pop-up is just like the one Newgrounds has; the background get's darkened and the content is in a div.
Now I couldn't figure out how to center (vertical and horizontal) the div with content. The div can't be centered by using margin, since it's position is absolute. I guess this would need to be done with Javascript.
The second problem is that setTimeout in Internet Explorer doesn't work like the rest of the browsers, you can't pass arguments to functions you call.. I've searched around a little bit and haven't found a solution. The problem is that I use a for-loop
Code: Select all
for (i=1; i<=100; i++) {
setTimeout(show_popup,i*4,i);
}Thanks in advance