I wrote some code that basically imitates Lightbox. Images that are too large will stretch the layout of my forum, so this code resizes them to an acceptable width (maintaining aspect ratio) and makes them clickable. When clicked, the page darkens (gradual fade) and a box opens up with the image inside it (gradual fade in). Check out an example here:
http://infectionist.com/forum/viewto...?p=23617#23617
I've always been able to figure out ways to do things I want done, but it's usually hacked together and while i works, it's certainly not the best way to do it. This is one of those cases. It's almost painfully slow on my computer, and I have 8 gigs of RAM and a 512MB GPU (3.0GHz dual core CPU.) Other sites that do this (using either Lightbox or some other code) don't have the same problem, and everything happens very quickly and smoothly.
I think it has to do with how many loops and settimeouts I'm doing, jumping between functions and all that, but I can't seem to pinpoint exactly what's causing the problem. If someone here could be so kind as to take a look at it for me, I would be ever so grateful. Here is a direct link to the Javascript file:
http://infectionist.com/misc/lightybox/lightybox.js
Thanks very much in advance, and please forgive how messy the code is, it makes perfect sense to me, but it gives other people headaches.