Results 1 to 5 of 5

Thread: How to include multiple values

  1. #1
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow How to include multiple values

    1) Script Title:
    Drop down/ Overlapping Content script
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...lapcontent.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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If you're trying to close multile overlapping contents, you need to call overlayclose() multiple times:

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

  3. #3
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Aug 2007
    Location
    Somewhere in the vicinity of Betelgeuse
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you change the overlayclose function to:
    Code:
    function overlayclose(){
    	for(var i = 0; i < arguments.length; ++i) {
    		document.getElementById(arguments[i]).style.display="none";
    	}
    }
    and then
    Code:
    <a href="#" onClick="overlayclose('subcontent2', 'subcontent3', 'subcontent4'); return false">
    it should do the trick.

  5. #5
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Gonna give it a try

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •