Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6919 closed bug (duplicate)

IE Error when opening a section for the second time

Reported by: joris Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.accordion Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

Sorry if this report is a bit incomplete, I am in bit of a hurry.

On one of our websites IE9 / IE8 gives a runtime error on line 559:

$.each( fxAttrs, function( i, prop ) {
	hideProps[ prop ] = "hide";

	var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
	showProps[ prop ] = {
		value: parts[ 1 ], // parts is null
		unit: parts[ 2 ] || "px"
	};
});

I am guessing this is because of the differences between computed style and current style.

The code used to create the accordion is:

$('#menu').accordion({
	header: '.menu_title',
	clearStyle: false,
	autoHeight: true,
	collapsible: true,
	animated: 'slide'
});

<div id="menu">
	<div class="box_top"></div>
	<div class="menu_item">
		<div class="menu_title">Bla bla bla</div>
		<div class="menu_content">
			bla bla bla ...
			<div style="clear:both"></div>
		</div>
	</div>
	<div class="box_bottom"></div>
	
	<div class="box_top"></div>
	<div class="menu_item">
		<div class="menu_title">Bla bla bla</div>
		<div class="menu_content">
			bla bla bla ...
			<div style="clear:both"></div>
		</div>
	</div>
	<div class="box_bottom"></div>
</div>

For now I fixed this issue by modifying it to:

$.each( fxAttrs, function( i, prop ) {
	hideProps[ prop ] = "hide";

	var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
	if (parts)
	{
		showProps[ prop ] = {
			value: parts[ 1 ],
			unit: parts[ 2 ] || "px"
		};
	}
	else
	{
		showProps[ prop ] = {
			value: 0,
			unit:  "px"
		};
	}
});

Change History (2)

comment:1 Changed 11 years ago by Scott González

Resolution: duplicate
Status: newclosed

Works fine for me in IE8: http://jsbin.com/uxepe5/edit. Didn't test in IE9, but this sounds like a duplicate of #6068.

comment:2 Changed 11 years ago by Scott González

Duplicate of #6068.

Note: See TracTickets for help on using tickets.