how about some jQuery :)
For starters, if you are new to jQuery, you might notice that you can create embedded jQuery using script tags inside your html web page, or you can create a separate one. js file that is associated with your html file (preferred) using the CDN ( here) or manually providing the script doc files yourself. I prefer to use google CDN because they have many servers that are most likely closer to the client and the client only needs to download scripts through the CDN once.
In the html, specify script tags, and then get started with JS and jQuery!
<head> <title>your webpage</title> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" type="text/javascript"></script> //BELOW IS YOUR OWN SCRIPT FILE REFERENCE! <script src="Scripts/Jscript1.js" type="text/javascript" ></script>
Also, if you want jQuery intellisense to work in the script file, all you have to do is add the link link in the script file that you are using!
/// <reference path="jquery-1.7.1-vsdoc.js" /> $(document).ready(function () { $('.toc-odd level-1').hover( function () { //show its submenu $('ul', this).slideDown(100); }, function () { //hide its submenu $('ul', this).slideUp(100); } );
});
The jQuery example above is just one way out of the millions that you can implement to render your code. If you are interested in learning a fast and concise library, check out jQuery for 30 days.
Good luck Ben
source share