Announcement

Collapse
No announcement yet.

Yet another SmartTabs question

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

    Yet another SmartTabs question

    I have the SmartTabs javascript at the very end of the page, just before the closing body tag. Store owner just asked me why if
    we do not wait until the webpage loads fully before we click on the 'Quantity Pricing' tab, it will redirect you to the home page
    I recognize this as "normal" behavior but I am wondering if I should move the javascript further up the page or would I just be opening myself up to conflicts in javascript? Is there anything I can do to help this little script along?
    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
    The script requires jQuery to run, to it has to happen after that call at the bottom. You could try deferring or asyncing the scripts. Also, you might check if there are scripts loading in before these, primarily third-party ones, which are slowing page loading.
    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
      Yeah, I knew the "order" is important. It does look like there are a couple of third-party scripts that have been inserted in between the

      Code:
      <script src="../js/plugins.js"></script>
      <script src="../js/scripts.js"></script>
      and the

      Code:
      <script src="/js/jquery.smartTabs.js"></script>
      <script>
      $('#js-smart-tabs--tabs').smartTabs({ layout: 'auto', contentHeight: 'auto' });
      </script>
      I'm going to try moving it up right underneath those two.
      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


        #4
        Shouldn't placing the function that handles the Tab link inside a documentReady test prevent that behaviour?
        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


          #5
          You are correct Bruce.
          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

          Working...
          X