PDA

View Full Version : How to include multiple values



majorvybz
09-11-2007, 03:34 AM
1) Script Title:
Drop down/ Overlapping Content script
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex5/overlapcontent.htm
3) Describe problem:

I tried adding multiple values to the script:

original :<a href="#" onClick="overlayclose('subcontent2'); return false">

I tested:

<a href="#" onClick="overlayclose('subcontent2, subcontent3, subcontent4'); return false">

and

<a href="#" onClick="overlayclose(" 'subcontent2', 'subcontent4' "); return false">

But efforts failed, please how do i add multiple values to the overlayclose function.

ddadmin
09-11-2007, 04:20 AM
If you're trying to close multile overlapping contents, you need to call overlayclose() multiple times:


<a href="#" onClick="overlayclose('subcontent2'); overlayclose('subcontent3'); overlayclose('subcontent4'); return false" >

majorvybz
09-11-2007, 06:09 AM
Thanks for the effort, but I have 11 menu items to assign this to, and from just including the code, i added a extra 4kb to the file size... so basically this method is kinda bulky....

Could there be some modification of the orginial code to support the features i need, thanx in advance...

and yeah I'm gonna convert this menu into a Joomla and Drupal module... Giving you full credit

Mr Moo
09-11-2007, 06:49 AM
If you change the overlayclose function to:


function overlayclose(){
for(var i = 0; i < arguments.length; ++i) {
document.getElementById(arguments[i]).style.display="none";
}
}

and then


<a href="#" onClick="overlayclose('subcontent2', 'subcontent3', 'subcontent4'); return false">

it should do the trick.

majorvybz
09-11-2007, 03:21 PM
Gonna give it a try