Results 1 to 8 of 8

Thread: Setting which pagination link is highlighted

  1. #1
    Join Date
    Nov 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Setting which pagination link is highlighted

    1) Featured Content Slider

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tentslider.htm

    3) Describe problem:
    The featured content slider is working great for me. I have the banner rotating automatically on the home page, leading the user to 4 different landing pages when they click on the tab or the content. Then I have the banner again on the landing page, but not set to autorotate When the user clicks through to the landing page, the tab for that content area is highlighted, because of the cookie the script sets. But if you come to the page via another link, the first pagination link is highlighted, not the "correct" one for that page.
    What I want to know is, is there anyway to set a cookie with the script so that a specific tab/content div is highlighted/visible.

    Thanks very much for all your help!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    There are a few ways of passing information from one page to another, so a script on the receiving page (in this case, Featured Content script) is instructed to do something accordingly. One of the ways talked about on the forums is using a URL itself to pass information. For example, this thread talks about how to get a particular tab within Ajax Tabs Content script to be selected if a user is coming from a specific URL: http://www.dynamicdrive.com/forums/s...ad.php?t=26799 Will a similar technique basically fit your need here?

  3. #3
    Join Date
    Nov 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If I understand correctly, that would work by placing a certain parameter on a link external to the page with the tabs, so that when they go to the page with the tabs, the correct tab would be highlighted. What I had in mind was something that wouldn't be dependent on the external link, so for example if the user clicked on a search engine result or a link on another web site, the correct tab would be highlighted on the page.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Yes, your understanding is correct. What you're asking is possible, but without using the URL of the browser to tell the script which featured content should be selected based on the page the script is in, you'll need to find another method. One obvious choice is to use the Real URLs version of this script to assign actual URLs to the pagination links of each featured content. For the featured content that you wish to be selected by default when the script is in a particular page, for example, "cat.htm", you would assign that URL to the pagination link in question.

    Putting it all together, first, download the below contentslider.js file, which is the most recent version of the stock script, with Real URLs added, plus the ability talked about above. Then, you would call the script using something like:

    Code:
    <div class="pagination" id="paginate-slider1"></div>
    
    <script type="text/javascript">
    //Define: ContentSlider("slider_ID", [autorotate_miliseconds], [custompaginatelinkstext], [customnextlinktext])
    ContentSlider("slider1", 5000, "", "", ['dog.htm', 'cat.htm', 'deer.htm', 'bear.htm'] )
    
    </script>
    The key is the part in bold- that's the real URLs option at work. One of the URLs, in this case, the red URL, then would correspond to the filename of the page that when the script is called in, will cause the featured content with pagination link "cat.htm" to be selected by default. In other words, if Feature Content script was added to the page "cat.htm", when that page is loaded, the corresponidng featured content will be selected by default as well.

    If you're confused, just post here, but that's the general idea.

  5. #5
    Join Date
    Nov 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I was working with a version of the Real URL's with a further option that clicking on the URL's goes to the actual link, from this thread: http://www.dynamicdrive.com/forums/s...ad.php?t=26816

    Is there any easy way to add on the clickability option to the script? I think this combination of functionality is going to be very useful in lots of situations.

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Do you mean so clicking on a pagination link takes the user to an actual URL, instead of toggle between the featured contents?

  7. #7
    Join Date
    Nov 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes, exactly.

  8. #8
    Join Date
    Nov 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Actually what I need is more like the Tab Content Script, maybe, but with a fade in.
    I need to have the correct tab selected and content displayed when the user loads the page, and then have the div swap content when they mouseover another tab, but then swap back to the original content when they mouseout.

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
  •