Javascript tab control

Posted on 2006-05-02
Last Modified: 2008-03-06
Is it possible to generate a control like the one used on this page to show C# and VB code in simple javascript and css?
On the page they use a .net control, but I need to be able to write it in html in my cms
Question by:thor_ostergaard
    LVL 63

    Accepted Solution

    If you look into that page source you will see all the JavaScript and Style definitions there.
    The JavaScript function call is:
    <TD class=backtab id=tabctl00$ctl00$Main_Body$MainBody$ctl01 onclick="doClick(0, 2, 'ctl00$ctl00$Main_Body$MainBody$ctl01')">C# </TD>
    <TD class=tab id=tabctl00$ctl00$Main_Body$MainBody$ctl01 onclick="doClick(1, 2, 'ctl00$ctl00$Main_Body$MainBody$ctl01')">VB </TD>
    <TD class=space>&nbsp;</TD></TR>

    And the <STYLE> definitions are immediately before that <table> definition.

    Author Comment

    Well - I can see that - but it's not simple!
    How about the doClick function?
    LVL 63

    Expert Comment

    Did you look into page source???
    Before the upper table rows is the <style> section.
    And before the <style> section is the <script> section with the doClick() function definition.
    They repeat the <script> and <style> definitions again and again for every example control placement!


    Author Comment

    Sorry, I didn't se the onClick function - .net has a lot of client scripts and i thought it was one of them
    LVL 63

    Expert Comment

    No problem.
    Good look :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Mobile App Development with PhoneGap

    PhoneGap can help you leverage your already existing HTML5, JavaScript, and CSS skills in order to create and deploy cross-platform mobile apps.This program comprehensively covers HTML5 mobile app development from top to bottom.

    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now