|
Magnificent Basturd™ ![]() Join Date: May 2004
Location: Atlanta
|
This isn't a television show.
I'm supposed to have a nav link that, when opened, takes you to an anchor in the page. Of course this works fine in normal situations, but in this case we're using the JQuery Accordion routine to collapse a lot of the information on the page. Some of the collapsed DIVs contain images. So of course the problem is that when the browser goes TO the correct anchor, the images haven't completed loading (the DOM isn't finished??) and so the target is "shifted" offscreen making it look like an error. I'm investigating using the JQuery "scrollto" routine, but am not yet sure if that will work. Alternately I'm wondering if the solution might be as simple as specifying the height of the images in the HTML. Does any of this make sense to you folks? ta. ... |
|
|
quote |
|
Veteran Member
Join Date: May 2004
Location: Tejas
|
Unless the server these images are on is incredibly slow, I’d use .scrollTo. I’m using that in a project at work right now and it’s pretty good.
|
|
|
quote |
|
Magnificent Basturd™ ![]() Join Date: May 2004
Location: Atlanta
|
I'm betting that you haven't used scrollto as a link to an anchor on a target page, and when employing collapsed DIVs with the Accordion script ON that target page.... or are you? (hopeful, but not too hopeful)
I've been given permission for a workaround in the organization of info on the site in lieu of spending 3 days teaching myself the ins and outs of the DOM. It would indeed be cool to learn more, but getting the job done is JOB #1 ;D ... |
|
|
quote |
|
Veteran Member
Join Date: May 2004
Location: Tejas
|
Quote:
The whole site is one long scroller with a fixed navbar and links on the page to collapsible divs. Basically what you need to do is add a class like ”toCollapsible” to any link that could go to a hidden target. Bind a new function to the click event of those links and then use the href to find the target in question. Use $.parent to walk up the DOM recursively checking if each one is hidden and un-hiding them in they are, stopping when you reach a visible parent. Though I’m not using jQuery UI’s accordion, just doing that manually as the UI option didn’t do what I needed. It should work the same way though. Now that I think about it, easier actually. Just walk up $.parent till you find the accordion, check if it’s hidden and show it. edit: Just realized that you’re probably talking about a link on another page to a target with a bunch of accordions. If so I’m not sure how I’d handle that. Maybe the BBQ plugin? |
|
|
|
quote |
| Posting Rules | Navigation |
|
|
| Thread Tools | |