0

I have the weirdest problem. I am implementing a simple gallery with a use of nivo slider jQuery plugin. Everything works perfectly when I test it on my local machine, however I am having an issue on an online hosted server.

The images do not tend to appear when you first open the website. There seems to be an issue with caching the images. when you reload the page (simple f5) everything works fine.

Rather than showing you the code, I think it would be better to show the site so you can see what firebug shows you: http://teslacreations.com/orangery/test.php

Does anyone have any ideas how to solve it?

3
  • seems fine in Chrome. How exactly does one reproduce the problem?
    – matt b
    May 2, 2010 at 22:44
  • Well, it is only fine when you open the page and refresh it straight after, so the images are taken from cache. It doesn't seem to work if you open it for the first time (at least on my and my friends' browsers). well, now it decided to work in IE. only in IE, that's akward, isn't it..
    – klon
    May 2, 2010 at 22:52
  • Works fine here in FF 3.6.3/Win. Strange problem in Opera 10.53/Win: all images appear below the sliding one May 2, 2010 at 23:06

2 Answers 2

0

Validate your XHTML! I had this exact problem with Nivo, and the issue was the containing div wasn't (under some circumstances) supplying the script with the proper dimensions.

My solution was to specifically state the dimensions of the container and viewport so nivo had something to grab onto.

If you're interested, take a look at the project here. Hope this helps.

1
  • Thanks for your input. nice site, by the way. I have just tried the very same scirpt on another server - everything works! I guess bluehost isn't the best provider afterall..
    – klon
    May 2, 2010 at 23:26
0

Sorted! God why it is always like that, that when you're struggling with a problem for hours and finally decide to post a question in the Internet, you find solution yourself in few minutes? ;)

well, for the people who might have the problem in future - adding a timeout before associating div with images to the Nivo Slider jQuery function solves it.

Interestingly, I found out by checking the code of the creator of the plugin - even though he never mentioned using js timeouts, he does it himself.

Thanks very much for your input guys regards

2
  • Using a timeout isnt always the best solution, but if its a simple project and it works, why not.. ;)
    – danp
    May 2, 2010 at 23:14
  • well, I agree ;) but can't find a better solution for now and the deadline is close. I may return to it in the future.
    – klon
    May 2, 2010 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.