..


Sponsored Links

Dynamic horizontal menu in VBScript

Article written by Luca Ruggiero

On the basis of Article Windows-style horizontal menu made ​​with JavaScript in DHTML, we see in this article how to make the same kind of dynamic horizontal menu using VBScript as the language for the implementation of a DHTML script.

This Article will not be used to implement a menu different from the one created in the article mentioned above: its purpose is to demonstrate how the VBScript is a scripting language that the client side, Javascript has the same potential, even against DHTML.

The image shown below is the final result of our script, identical to the already mentioned Article

we use a simple HTML tables and CSS to create the functional structure / style of the menu, whose codes are always available by clicking in the article cited above. On the same page at the end of the article, you will also find the code for the implementation of the JavaScript functions for opening and closing of individual menu items.

Below, however, the translated code in VBScript:






 <script LANGUAGE="VBScript">









 Function Open (m)



    



 document.getElementById (m). style.visibility = "Visible"







 End Function









 Function close (m)



    



 document.getElementById (m). style.visibility = "hidden"







 End Function









 </ Script>



Compared with the Javascript code of the Item you may notice that the differences are purely syntactic and non-functional, since, as I said, DHTML is always the same with any client-side scripting language.

For complete list of the syntactic differences between teaching the JavaScript and VBScript code:

  • the Function keyword in VBScript is written with a capital letter in Javascript instead that, although the VBScript language is not case-sensitive;
  • VBScript does not use braces to delimit the contents of the function, but using the form End Function;
  • VBScript does not use a semicolon (;) to close a final line of code, although it is optional but recommended JavaScript.
Having said that let you choose the language to be used for the implementation of your DHTML scripts.

In the same category ...
E-Learning
ASP Zero (Ebook) ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €.
Visual Basic 6 (Course) Visual Basic 6 (Course)
Make Desktop Applications with VB6. From 39 €.
Sponsored Links