Results 1 to 2 of 2

Thread: Glossy Accordion Menu IE 7 and IE 7 modes

  1. #1
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default Glossy Accordion Menu IE 7 and IE 7 modes

    1) Script Title: Glossy Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-glossy.htm

    3) Describe problem: Even on the demo page, if you view it in IE 7 or IE 8 in IE 7 mode or in IE 8 Compatibility View, there are gaps above the expandable headers:

    CSS Examples

    and:

    CSS Drive

    In IE 9 in IE 7 mode or in IE 9 Compatibility View these gaps are not there on page load. They do however appear once the headers are expandled.

    In all 3 of these browsers, the problem happens here:

    Code:
    	transformHeader:function($targetHeader, config, state){
    		$targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
    		.removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
    		if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
    			$targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
    			$targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
    		}
    		else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
    			$targetHeader.find('.accordprefix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
    		else if (config.htmlsetting.location=="suffix")
    			$targetHeader.find('.accordsuffix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
    	},
    And can be fixed without harming other browsers or other IE modes by changing that function to:

    Code:
    	transformHeader:function($targetHeader, config, state){
    		$targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
    		.removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
    		if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
    			$targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
    			$targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
    		}
    		else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
    			$targetHeader.find('.accordprefix').empty().append((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
    		else if (config.htmlsetting.location=="suffix")
    			$targetHeader.find('.accordsuffix').empty().append((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
    	},
    Updated file:

    Attachment 4533
    Last edited by jscheuer1; 07-09-2012 at 06:10 AM. Reason: update comments in attached file
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Default

    Awesome, thanks for the code fix, applied to the script!
    DD Admin

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
  •