If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Javascript running very slowly, basic problem I think!!

Hi,

This is my first post so please correct me if I have done anything wrong.

I have written an application from scratch which expands a div and then displays a photo within a div. There is nothing wrong with the application as it all works fine in IE 8 and 7. However the problem I am having is that it runs very slowly. I have not got it to work yet in any other browsers but I am not worried about this quite yet. All I want to know is why the script is running very 'glitchy' in IE.

It may not have anything to do with my script because yesterday I left my computer on with my page loaded up and I had a click on one of the images and the application worked perfectly smoothly, I then played arund and everything was working as it should. Then I turned my computer back on this morning to find the problem had returned.

I am using the setInterval function to expand the divs. The problem may be that my script is rather long and therefore the browser finds it hard to process it quickly.

If you need to see my code then please let me know and I will post it if I workout how. You can preview the page at the following address

My advice to you is to start again, and to get it to work in Firefox or Opera first, then move on to Internet Explorer. And this is a relatively simple thing, it doesn't need huge amount of code, and if you are using huge amounts of code, you could be going about it the wrong way.

By the sounds of it, it just sounds like the delay while the image is being loaded. If you precache the images, it should speed up.

I thought that may be the solution, the problem I have is that I am not too sure how I could simplify my code and also make it compatible with firefox and opera. Is there anyway I could send it to you and you point out some areas I could change?