• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

HTML tabs with no round trip to server

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

    HTML tabs with no round trip to server

    I'm looking for some code to do html tabs. Easy enough to do with CSS, but I don't want a round trip with every tab click. Rather I would like the tabs to display the relevant content without doing a round trip, possibly with some client side java script to say, hide a panel and display the next panel.

    Anyone got any linkys. Googled but got nuttin.
    Knock first as I might be balancing my chakras.

    #2
    http://jquery.com

    just need some basic css and use a bit of jQuery to hide/display the tab. numpty stuff tbh, what was your specialism again...

    Comment


      #3
      Like this?
      How did this happen? Who's to blame? Well certainly there are those more responsible than others, and they will be held accountable, but again truth be told, if you're looking for the guilty, you need only look into a mirror.

      Follow me on Twitter - LinkedIn Profile - The HAB blog - New Blog: Mad Cameron
      Xeno points: +5 - Asperger rating: 36 - Paranoid Schizophrenic rating: 44%

      "We hang the petty thieves and appoint the great ones to high office" - Aesop

      Comment


        #4
        Originally posted by Ardesco View Post
        http://jquery.com

        just need some basic css and use a bit of jQuery to hide/display the tab. numpty stuff tbh, what was your specialism again...
        Not jquery.

        Thanks for your help. This is one thing about IT that urks me though.

        I can have worked in the industry for 13 years as a programmer, have countless years experience in loads of different technologies, databases, CMS, DMS, object oriented languages, yada yada yada and just because I don't know jQuery I'm suddently a numpty.

        Can't wait for my plan B to take off.
        Knock first as I might be balancing my chakras.

        Comment


          #5
          If you include the Javascript and CSS files as links they will be cached by the client so no round trip necessary.

          Have I missed the point here?
          +50 Xeno Geek Points
          Come back Toolpusher, scotspine, Voodooflux. Pogle
          As for the rest of you - DILLIGAF

          Purveyor of fine quality smut since 2005

          CUK Olympic University Challenge Champions 2010/2012

          Comment


            #6
            Originally posted by Zippy View Post
            If you include the Javascript and CSS files as links they will be cached by the client so no round trip necessary.

            Have I missed the point here?
            Yes.

            The CSS tab tutorials I found styled a <ul> and each <li> was <a>ed, each href then displayed a different page, with the respective clicked "tab" shown in a different colour.

            This means round trips to the server.

            I am using some jscript to show and hide divs at the moment. Seems to work in FF so should be good in IE.
            Knock first as I might be balancing my chakras.

            Comment


              #7
              So you need to load all the info in one hit and then just hide/show (and change your tabs)?
              +50 Xeno Geek Points
              Come back Toolpusher, scotspine, Voodooflux. Pogle
              As for the rest of you - DILLIGAF

              Purveyor of fine quality smut since 2005

              CUK Olympic University Challenge Champions 2010/2012

              Comment


                #8
                Originally posted by Zippy View Post
                So you need to load all the info in one hit and then just hide/show (and change your tabs)?
                Yip.
                Knock first as I might be balancing my chakras.

                Comment


                  #9
                  I'm not saying your a numpty because you don't know jQuery, i'm saying it numpty stuff i.e. not particularly difficult.

                  To do 4 tabs all you need to do is have 4 specific areas of the site and use css to hide and display them when an href is clicked.

                  Something like:
                  Code:
                  <ul>
                  <li><a href="one"></li>
                  <li><a href="two"></li>
                  <li><a href="three"></li>
                  <li><a href="four"></li>
                  </ul>
                  <div id="one"> Tab one content here</div>
                  <div id="two"> Tab two content here</div>
                  <div id="three"> Tab three content here</div>
                  <div id="four"> Tab four content here</div>
                  then default div id's two three and four to display: none.

                  Then a snippet of javascript (or jQuery because you will be able to do in in one line after spending about 5 mins on the jquery site) that will set one of the divs to display: block and all the other divs to display: none when you click on the links in the <ul>

                  Really not that hard conceptually. If you don't like the idea of display none you can set an absolute position of -9999em or something.

                  Comment


                    #10
                    Originally posted by suityou01 View Post
                    Yip.
                    OK. Show and hide divs is good. You can change styles for the tabs using Jscript (but FF and IE are different)
                    I'll confess that I don't know what the big problem is here. Sorry
                    +50 Xeno Geek Points
                    Come back Toolpusher, scotspine, Voodooflux. Pogle
                    As for the rest of you - DILLIGAF

                    Purveyor of fine quality smut since 2005

                    CUK Olympic University Challenge Champions 2010/2012

                    Comment

                    Working...
                    X