PDA

View Full Version : Accordion Content Script (v-2.0) with added option ("scrolltoheader")



Rui Belo
11-08-2012, 02:41 AM
1) Script Title: Accordion Content script (v-2.0) with added option ("scrolltoheader")

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

3) Describe problem: Greetings to all. This is my first posting at DD. The problem or rather the 'challenge' I have is with the added option ("scrolltoheader") used to scroll the expanded header in question after it expands (when a header contains long content) to the top edge of the browser window. Everything works as this great script is supposed to but with the 'scrolltoheader' feature, I want to be able to have it scroll not to the very top edge of the browser windows but instead to about 16 pixels below that top edge.

I have looked and looked and tried a few things but just can't figure out what I need to change or add. I assume the change is to be made to the 'ddaccordion.js' but I'm not entirely sure. I am not a coder in the least sense, I'm just a copy and paste weenie.
This is the link to the page I am working on:

fix-my-computer.net/top-web

Please remember though that I know nothing about coding but I can type, copy and paste :)
Thank you kindly in advance to anyone who can offer some how to help.

vwphillips
11-08-2012, 09:55 AM
scrollToHeader:function($targetHeader){
ddaccordion.$docbody.stop().animate({scrollTop: $targetHeader.offset().top-16}, 400)
},