aleX_hill Posted October 26, 2007 Share Posted October 26, 2007 I am wracking my brains trying to figure out how to fix this problem, so I hope someone out there has seen it before, or can help me fix it. Basically I have a rollover menu which when rolled over, the image itself changes, and changes another image as well. This can be seen on my site at www.hcdesigns.com.au The problem, however, is that when you rollover one of the menu items before they all load, the image does not load (the image properties are pointing at hcdesigns.com.au/undefined . If the page has finished loading, everything works fine. Another small problem is with the portfolio section, When the page loads, it should set the opacity of each div to 40%. This doesnt happen though, unless it is the second time you view the page (well load that part using AJAX). The images are all preloaded though, so I dont know how to get around this. Any help is greatly appreciated. Alex Link to comment https://forums.phpfreaks.com/topic/74862-solved-image-rollover-returns-undefined-image/ Share on other sites More sharing options...
fenway Posted October 26, 2007 Share Posted October 26, 2007 Then don't enable the rollovers until page load is complete... Link to comment https://forums.phpfreaks.com/topic/74862-solved-image-rollover-returns-undefined-image/#findComment-378616 Share on other sites More sharing options...
rajivgonsalves Posted October 26, 2007 Share Posted October 26, 2007 the problem is with the onmouseover the part "javascript:" remove that it should work fine then Link to comment https://forums.phpfreaks.com/topic/74862-solved-image-rollover-returns-undefined-image/#findComment-378629 Share on other sites More sharing options...
aleX_hill Posted October 26, 2007 Author Share Posted October 26, 2007 rajivgonsalves : The "javascript:" is only in the href= section, not on any events. fenway : How would I disabe rollovers until the page has loaded? (I am only new to js). Thanks Link to comment https://forums.phpfreaks.com/topic/74862-solved-image-rollover-returns-undefined-image/#findComment-378941 Share on other sites More sharing options...
aleX_hill Posted October 26, 2007 Author Share Posted October 26, 2007 I solved the problem... The js grabbed the current image in the header. and set it to a global var. This was then used in the revertImage function. The var wasnt getting the src though because the rollover was called before the source was displayed. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/74862-solved-image-rollover-returns-undefined-image/#findComment-378947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.