What kind of script can do this?

Discussion in 'Programming' started by ian_batten, Nov 13, 2007.

  1. #1
    Hi guys,
    I am looking for a script similiar to what you can see in this link (sorry, it's a bit of a random link, but thought it was a great example.)

    http://www.ca-store.co.uk/spyware/anti_spyware.aspx?sc_lang=en-GB

    If you scroll down slightly, you will see the box with the "overview" section. Every time you click on another tab, such as "system-requirements", or "screenshots", it automatically changes the content of the box without refreshing the page.

    What kind of script can achieve this? I would like to use this for some information pages on a website I am doing at the mo.

    Thanks in advance.
     
    ian_batten, Nov 13, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    They have created it using one of Microsofts .Net Ajax components - see below link

    http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Tabs/Tabs.aspx

    It can however be created using other methods such as basic javascript but they use the .Net version as it allows the codebehind to much more easily control the component and also for it to remember the position on a full postback
     
    AstarothSolutions, Nov 13, 2007 IP
  3. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #3
    It's not AJAX. Notice that it loads instantly which means that it's simply Javascript, not AJAX. AJAX has a delay while the external file is loaded.

    He changes the class of a div between hidetabContent and tabContent, which uses CSS to be display: hidden;.
     
    live-cms_com, Nov 13, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Not all of the .Net Ajax components are actually Ajax themselves - the majority arent - but they are still the "Microsoft Ajax ToolKit" by name

    On this occasion however I was wrong as the jscript for the tabs is http://www.ca-store.co.uk/upload/common/tabcontent.js
     
    AstarothSolutions, Nov 13, 2007 IP
  5. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #5
    And if you were to write that code yourself it could be simplified to about 20 lines, I think.
     
    live-cms_com, Nov 13, 2007 IP