PDA

View Full Version : 'contentdivs[...].style' is null or not an object



student101
10-29-2009, 08:17 AM
Featured Content Slider v2.4 and RSS Display Box (on the same page)
http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm
http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm

Tested on IE7, Firefox and IE8 for some odd reason I get this error on one page, the others work fine.
'contentdivs[...].style' is null or not an object

I don't have this online.
Any ideas?

Featuredcontentslider version is attached.

I think I may have solved this one... Not sure?
rssdisplaybox.js line 25 -> Red needed to be removed as the image was already in the rssbox folder.

this.loadingHTML='<img src="'+rssoutputscript.replace('main.php', '')+'/loading.gif" /> Initializing RSS Display Box...'
//Specify HTTML to show while feed is being fetched

student101
11-04-2009, 03:53 PM
Tested in Google Chrome and the Featured Content Slider stopped working again.
This is amazing code but what happens if the code breaks like this?
I surely can't be the only one who has had this issue.

Looks like visibility:hidden; is a problem.

Tested script with AHAH after doing this /*visibility:hidden;*/ it all worked, this is still unconfirmed as nobody with javascript knowledge has bothered to answer my first post :confused:
It can't be this simple, there must be something else that caused the first error, then all of a sudden disappeared. :eek:

Odd :rolleyes:

ddadmin
11-04-2009, 07:55 PM
Are there any other scripts besides these two scripts on the same page? As far as O cam see both of the possible issues you cited above shouldn't be an issue. A link to the actual page would make it a lot easier to debug btw.

student101
11-04-2009, 09:22 PM
Just sent a PM
I have Firebug for Firefox.
Debug bar and IE developer toolbar for IE8, tried to debug but maybe my methods / knowledge is limited.

ddadmin
11-05-2009, 05:45 AM
I've read your PM. Looking at the associates.php URL you sent me, I don't get any JavaScript errors in FF 3.x nor IE8 when clicking around. Is there something specific I need to do to generate the error?

student101
11-05-2009, 06:17 AM
I've read your PM. Looking at the associates.php URL you sent me, I don't get any JavaScript errors in FF 3.x nor IE8 when clicking around. Is there something specific I need to do to generate the error?

Yes, that's just it!
When you load it the first time it works,
if you stick around and click other pages, its almost as if the associates javascript forgets to load after opening it again? :confused:

You may need to open this two or three times in different browser sessions at the same time, but start at the index.php page

That is why I say odd, very odd? :eek:

If there was a method to load the javascript and check that it's loaded, then maybe that would be an answer.

Message: 'contentdivs[...].style' is null or not an object Line: 153
Char: 3
Code: 0
URI: contentslider_pause.js

student101
11-05-2009, 10:06 PM
ddadmin, thanks for respodnding,
I guess I can't use the Featured Content Slider.

Regards.

Is there a method or a way for me to stress test this?

ddadmin
11-06-2009, 10:00 AM
Ah ok after quite some time going from page to page and clicking various things at random, I was able to duplicate the problem. I believe I know what's going on now, which has nothing to do with RSS Scroller, but simply FCS. The problem occurs since on the "divisions" page, your FCS contains 8 toggler links (ie: Feature 1, Feature 2 etc), while on the other pages, it only contains 6. If you click on "Feature 8" on "divisions" for example, then go to the "associates" page, the error occurs, as the script tries to "persist" the 9th toggler link on the later page, which doesn't exist. In other words, this is a bug that can be duplicated consistently.

To fix this issue, inside contentslider.js, try finding the line below, and add to it above it the two lines in red:


setting.currentpage=Math.min(setting.contentdivs.length-1, setting.currentpage)
setting.prevpage=setting.currentpage
this.turnpage(setting, setting.currentpage, true)

Not fully tested yet, but should work.

student101
11-06-2009, 02:39 PM
Ah, I see!
I always wondered why when I clicked Feature one on Associates, then opened Divisions, Feature one would also be selected, the clue was in my face all along!

I'm using the paused content slider, attached.
Still the same after clearing the cache and attempting the fix.

So the question; how to remove the persistance of the javascript?

ddadmin
11-06-2009, 07:36 PM
Ok, lets see if disabling persistence fixes the issue for you then. Using the original contentslider.js file, try setting the following line to false:


var featuredcontentslider={

//3 variables below you can customize if desired:
ajaxloadingmsg: '<div style="margin: 20px 0 0 20px"><img src="loading.gif" /> Fetching slider Contents. Please wait...</div>',
bustajaxcache: true, //bust caching of external ajax page after 1st request?
enablepersist: false, //persist to last content viewed when returning to page?

student101
11-06-2009, 10:44 PM
Yes, with the original contentslider.js enablepersist: false, is definitely the answer!
Good one, Thank you!!!

How to apply a pause on mouseover?

Silly question, me being lazy!
For anyone watching this thread, here is a fully functional non-perstistant-pausing-onmouseover FCS attached.

SpaceGeneral
12-17-2009, 01:34 PM
This is a dirty fix:

Change:
if (setting.cacheprevpage!=setting.currentpage){ //if previous content isn't the same as the current shown div
to
if (setting.cacheprevpage-1 && setting.cacheprevpage!=setting.currentpage){ //if previous content isn't the same as the current shown div

NOTE:
No fully tested!