PDA

View Full Version : Help with Drop down/ Overlapping Content



Grey83
02-03-2010, 05:20 PM
1) Script Title: Drop down/ Overlapping Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/overlapcontent.htm

3) Describe problem:

Hi, ive installed Drop down/ Overlapping Content script and it works very well on ff, but on ie i get this error:

Line: 117
Error: 'null' is null or not an object

Line 117 is:


var subobj=document.getElementById(anchorobj.getAttribute("rel"))

Besides i get also this message in debug window:

'dropdowncontent' is undefined.

Can I solve this problem?

Grey83
02-03-2010, 05:46 PM
I undestand the problem...

My site is a bulletin board and i've added a php condition to use this script. It's a thing like:


<a href="page.html" <?php if permission...etc. ?>id="quickslink" rel="quicks"<?php end condition ?>>CLICK</a>

Now the problem is that if user has permissions to use the script anything works ok, otherwise users get that error. Is there a method to solving it?

ddadmin
02-03-2010, 07:39 PM
Inside the .js file, try adding the changes in red below, which checks to see if the drop down DIV actually exists on the page before proceeding to initialize it:


init:function(anchorid, pos, glidetime, revealbehavior){
var anchorobj=document.getElementById(anchorid)
var subobj=document.getElementById(anchorobj.getAttribute("rel"))
if (!anchorobj || !subobj)
return

ddadmin
04-08-2010, 03:01 AM
Update: Use this code instead:



init:function(anchorid, pos, glidetime, revealbehavior){
var anchorobj=document.getElementById(anchorid)
if (anchorobj)
var subobj=document.getElementById(anchorobj.getAttribute("rel"))
if (!anchorobj || !subobj)
return