Click here to Skip to main content
15,897,273 members
Articles / Web Development / HTML

AWUI - a simple web user interface library with AJAX support

Rate me:
Please Sign up or sign in to vote.
4.33/5 (5 votes)
26 Jul 2007CPOL4 min read 47.9K   382   35  
An article on creating a custom JavaScript controls set and cross-browser support library
<html>
<head>
	<title>aSlider test</title>
	<script language="JavaScript" src="js/awui.js"></script>
	<script language="JavaScript" src="js/aslider.js"></script>
	<script language="JavaScript" >
		function applyColors()	{
			var val = String(AWUI.el("selScheme").value);
			if (val == "win"){
				slider2.setColors (	"ButtonFace", "ThreedDarkShadow", "ButtonShadow",	"ButtonHighlight", "ButtonFace", "ButtonShadow");
			
			} else if (val == "gray"){
				slider2.setColors (	"#DDDDDD", "#000000", "#808080", "#FFFFFF", "#DDDDDD", "#808080");
			
			} else if (val == "flat"){
				slider2.setColors (	"#DDDDDD", "#DDDDDD", "#808080","#808080", "", "");

			} else if (val == "green"){
				slider2.setColors (	"#00aa00", "#00aa00", "#008000", "#008000", "", "#008000");
			}

		}
		
		function onScroll(obj_, pos_)
		{
			window.status = obj_ + ": " + pos_;
		}
	</script>
	
	<style>
		 BODY {	font-family: "Trebuchet MS", Arial, Helvetica; background-color: white; font-size: 9pt;}
		 TABLE {	font-size: 100%;}
		 A {color: #ff9933; text-decoration : underline;}
	</style>
</head>

<body style="padding: 10;">
	<br><br><br>
	
	<table style="border-collapse:collapse;">
		<tr>
			<td style="padding: 5px; border: 1px solid #cccccc;">
				<script>
				var slider = new aSlider( 1, 200);
				slider.margin = 40;
				slider.onscroll = onScroll;
				slider.draw("target1");
				</script>
				<br>
				<input type="text" id="target1" style="width: 200px;" value="1">
			</td>
			<td style="padding: 5px; border: 1px solid #cccccc;">
				<script>
				var slider2 = new aSlider(50);
				slider2.draw("", 300, 30);
				</script>
				<br>
				<select style="width: 100px" id="selScheme" onchange="applyColors();">
					<option selected value="win">Windows</option>
					<option value="gray">Gray</option>
					<option value="flat">Flat</option>
					<option value="green">Green</option>
				</select>
			</td>
		</tr>
	</table>

	
	
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions