Scrolls to top of screen when clicking on accordion heading

taldrup - August 8, 2008 - 13:54
Project:Panels Accordion
Version:5.x-1.0-beta
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Love this module, Thanks.

I found that if the accordion is on a scrolled page, when you click on a header, the page snaps to the top of the screen.

This is because of the href="#" in panels_accordion.module forces the browser (in my case firefox 3) to go to a non-existent bookmark on the page and so scrolls up.

$pane->subject = '' .strip_tags($pane->title, '

'). '

';
$pane->title = '' .strip_tags($pane->title, '

'). '

';

I changed this too:
$pane->subject = '' .strip_tags($pane->title, '

'). '

';
$pane->title = '' .strip_tags($pane->title, '

'). '

';

This fixes the scrolling problem, but does mean that the pointer is a text selector rather than a hand for the link.
I corrected that by putting this in my css.

#navMain a:hover {
cursor: pointer;
}

My accordion had a div around it like this:

There may be a better way to assign the cursor globally to the accordion code - anyone have an idea?

#1

asak - September 6, 2008 - 15:06

In my case, both panes are open, and clicking the title takes me back to the top of the screen.

Is this the same as your case?
Do your panes actually collapse?

#2

asak - October 6, 2008 - 13:16

Could you possibly paste your code again, between <code>...</code> tags ?

I'm having the same problem...

Thanks!

#3

davexoxide - November 29, 2008 - 22:15
Status:active» closed

updated dev branch... doing new beta release soon
this should address those issues

 
 

Drupal is a registered trademark of Dries Buytaert.