Results 1 to 7 of 7

Thread: Advanced Gallery script: Links to Content in Viewer

  1. #1
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Advanced Gallery script: Links to Content in Viewer

    1) Script Title: Advanced Gallery script

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

    3) Describe problem: I'm working on a site that has long, content-rich pages and I would like to use the Advanced Gallery script, the Switch Content Script, or another script from the Dynamic Content section of your site in to allow visitors to choose which sections of the page they would like to view. However, anchors or links only work when the particular section in which the link appears is on display. Is there a solution to this problem? Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    links only work when the particular section in which the link appears is on display.
    How would or could any link work when it wasn't being displayed? How would anyone even know that it was there? If a link is so important that it must be available at all times, put it in a section of the page that is always visible.

    If I have misunderstood the situation, please provide a link to your page and a better explanation of the problem.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Clarification: Anchors to Dynamic Content

    Thanks for your question and sorry for being confusing. I'm new to this and in over my head.

    Here's the format I'm trying to use on my pages:

    1) an always-visible paragraph that summarizes the information available as dynamic content below.

    2) a menu so that users can choose which topics they wish to see in the gallery viewer which appears below the menu.

    I would like to be able to put anchors in the summary (or on other pages of the site) so that users could call up a topic of interest in the gallery viewer. However, normal anchors only work if the topic has already selected that topic in the menu and opened it in the gallery viewer.

    You can see an example of a page using the Advanced Gallery Script at: http://mac110.assumption.edu/aas/intros/b.html.

    Another experiment using Switch Content Script II http://www.dynamicdrive.com/dynamici...chcontent2.htm can be seen at http://mac110.assumption.edu/aas/intros/c.html I can set up the page so that everything is expanded at the beginning and all the anchors work, but that defeats the purpose of having a page that looks less overwheming when you open it.

    Thanks for any help you can give. As I said, I'm in over my head.
    Is there a way to have the anchors open the dynamic content? Do I need a different solution entirely?

    Lucia

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I see. I worked out a solution for linking to a page and opening a content block and for opening a content block on a page from a link outside the content menu using Switch Content Script. Here is a link to that thread containing that solution and a link to a demo of it:

    http://www.dynamicdrive.com/forums/s...ead.php?t=4138

    Your situation is a little different in that you also want to anchor link to that open section on the page. That may be able to be done, but it might not. If possible, it would be tough to work out. There is an easier approach to the same effect. That would be to have your anchor outside the area that is displayed/not displayed, just above it or below it. If you set up the switch content script to always collapse previous, you would need only one anchor link for all contents as, once displayed, any given revealed content will be at the same spot on the page as any other.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default One Step Closer

    Ah, progress, thanks to your advice. I have been able to use the answer you provided to link to a page with dynamic content, and have a specific block of content open up to view. However, the link takes the visitor to the top of the dynamic page, and since the gallery viewer is at the bottom of the page, s/he is unlikely to notice the dynamic material to which the link/anchor was intended to refer. You can see how this works by going to http://mac110.assumption.edu/aas/intros/f.html

    If this was a "normal" kind of web page, I would use a link with an anchor:
    <a href="c.html#history">

    So I have tried to incorporate an anchor into the code you suggested
    <a href="c.html#history?sc=3">
    but it doesn't work. Any more thoughts? Your help has been VERY valuable, and I really appreciate it.

    Incidentally, the discussion thread you linked me to also offered a solution I've been able to use in order to create anchors to dynamic material on the same page:
    <a href="#" onClick="expandcontent(this, 'sc2')" >Link text here</a>

    I've tried that on an experimental page and it works. You can see how the anchors work by trying the links in the opening summary:
    http://mac110.assumption.edu/aas/intros/e.html

    Thanks again for all of your help. The clouds are beginning to lift.

    Lucia

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Change this line:

    Code:
    var scNum=unescape(location.href).substr(unescape(location.href).indexOf('?sc=')+4)
    to:

    Code:
    var scNum=parseInt(unescape(location.href).substr(unescape(location.href).indexOf('?sc=')+4))
    Move this anchor:

    Code:
      </blockquote>
    </div>
    
      <h3 align="center" class="style4" style="cursor:hand; cursor:pointer" onClick="expandcontent(this, 'sc3')">The First African-American Regiments and Their Reception</h3>
      <div id="sc3" class="switchcontent">
      <blockquote>
        <p align="left"><a name="history"></a>Many of the sol
    to here:

    Code:
      </blockquote>
    </div>
      <h3 align="center" class="style4" style="cursor:hand; cursor:pointer" onClick="expandcontent(this, 'sc3')">The First African-American Regiments and Their Reception</h3>
    <a name="history"></a>
      <div id="sc3" class="switchcontent">
      <blockquote>
        <p align="left">Many of the sol
    Link to the page using this syntax:

    HTML Code:
    <a href="e.html?sc=3#history">Link Text</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    WOW! I had just about given up trying to solve that problem. Thanks for your help--it will make a tremendous difference in my project.

    Lucia

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •