Announcement

Collapse
No announcement yet.

More fun with SmartTabs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    More fun with SmartTabs

    I would like to create a link that opens one of the tabs. Oddly enough I have it working on one product page but it doesn't seem to work on any other.

    What I have in place for the link

    Code:
    <a href="/&mvt:global:product_code;.html#samplebox">Sample Policy &gt;</a>
    Within the tabbed content

    Code:
    <dt><a href="#samplebox">Samples</a></dt>
                        <dd>
                        <div class="prod-tabbox-content" id="samplebox">
    (I had used an id tag previously for another jump link and it works.)

    When I first set it up, it worked on this page (now it doesn't). If you reload the page with the #samplebox, it does open the tab. I suspect I need some sort of javascript snippet to make this work the first time, every time?



    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Hi Leslie,

    I haven't revisited this code in about 5 years. However, if memory serves, you would add a value to the HREF that you want the URL hash to go to. If if you wanted tab 2 to open, you would change the HREF from # to something like #tabtwo. Then, if the url is myurl.html#tabtwo, it should open on load.
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      if that doesn't work, make sure there is only one ID of that name on the page.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        Originally posted by Matt Zimmermann View Post
        Hi Leslie,

        I haven't revisited this code in about 5 years. However, if memory serves, you would add a value to the HREF that you want the URL hash to go to.


        If if you wanted tab 2 to open, you would change the HREF from # to something like #tabtwo. Then, if the url is myurl.html#tabtwo, it should open on load.
        That sounds like exactly what I have done. Seems if you reload the URL in the browser it will open the tab, but it doesn't jump down to it.
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


          #5
          Originally posted by Bruce - PhosphorMedia View Post
          if that doesn't work, make sure there is only one ID of that name on the page.
          Yup, there is only one to rule them all.

          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment

          Working...
          X