Opened 10 years ago

Closed 10 years ago

#6713 closed bug (notabug)

anchor whose href matches current page passes accordion navigationFilter

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

Description

if I have a page: http://www.example.com/thispage.html

and i have an anchor within one of the of the accordion sections: <a href="http://www.example.com/thispage.html"><img src="this_thumbnail.jpg"></a>

this will return true for the default navigationFilter, and cause this accordion section to open when the page loads, regardless of the intialized active state.

As a workaround, since i'm already using the BBQ plugin, i changed the navigationFilter to:

return $(this).attr("href").replace("#","") == $.param.fragment();

this way i'm only comparing the fragment of the href, not the entire href.

a better solution would be to limit the matched anchors to just the head element of the accordion, and not parse the href of all the anchors in the accordion content. if i have 1,000 of links loaded into the accordion, for instance, that's a lot of extra work just to find what the href of the accordion header is.

Change History (1)

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

Resolution: invalid
Status: newclosed

This is not a bug, this is per design. If you want something else just set the active option properly on init.

Note: See TracTickets for help on using tickets.