Δ
Thursday, March 31st, 2011
Δ
Show Time
How to show time in a popup dialogue box; you could add
this to a button.
Demo:
to
be added
Javascript
<script type="text/javascript"> <!-- function showtime1(){ var now =
new Date() var hours = now.getHours() var minutes = now.getMinutes()
var seconds = now.getSeconds() var timeValue = " " + (hours > 12 ? hours - 12
: hours) timeValue += (minutes < 10 ? ":0" : ":") + minutes timeValue +=
(seconds < 10 ? ":0" : ":") + seconds timeValue += (hours >= 12 ? " p.m." : "
a.m.") timerID = setTimeout("showtime1()",1000)
document.title=timeValue //This line displays the time in the title bar
window.status =timeValue // This line displays the time in the status bar
document.clock1.button.value = timeValue // This line displays the button
clock in the body section
document.getElementById("clock2").innerHTML =
timeValue // This line displays the text clock in the body section
document.getElementById("clock3").innerHTML=timeValue // This line displays the
time within a line of text
document.getElementById("bgclock").innerHTML =
timeValue
// Delete the display lines you do not require }
//
add onload="showtime1()" to the opening BODY tag
//--> </script>
<script type="text/javascript"> <!-- function showTime2() { var
now = new Date(); alert("It is now " + now.toLocaleString()); } //-->
</script>
<form> <INPUT TYPE="button" VALUE="Show time"
onClick="javascript:showTime2()"> </form>
|
Δ
Change Background Colors Automatically
How to change your background to cycle through colors; web
page effect.
Demo:
to
be added
HTML/Javascript
<HTML> <HEAD> <TITLE>Javascript Cycling Background Color</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- bcolors = new
Array("red","green","blue","orange","black", "brown", "yellow") bgit = -1
bgout = bcolors.length function colorit(){ if (document.images) {
bgit++ if (bgit == bgout) { bgit = 0} document.bgColor=bcolors[bgit]
setTimeout("colorit()", 5 * 100) } } // --> </SCRIPT> >
</html>
|
Δ
Frameless Partylight With Text Overlay
How to show animated light with text on top.
Demo:
to
be added
HTML/Javascript
<html> <body bgcolor=#000000> </html>
<html> <HEAD>
<HTA:APPLICATION ApplicationName="AnimatedPartyLight" ID =
"AnimatedPartyLight" BORDERSTYLE="normal" Border="none"
INNERBORDER="no" SingleInstance="Yes" WindowsState="normal" Scroll="No"
Navigable="No" MaximizeButton="No" SysMenu="no" Caption="no"
showInTaskBar="no" > </HEAD>
<!-- add a small white.bmp here-->
<BODY onload="init()" background="white.bmp" ID="picture" STYLE="filter:Light;"
ALIGN="left" >
<script language="vbscript"> Window.ReSizeTo
125,200 Window.moveTo 100, 100 </script>
<script
type="text/javascript"> <!-- function initArray(num) { for (var j=0; j <
num; j++) this[j] = 0; }
// try to speed up by pre-calculating sines and
cosine values: var sinLookup = new initArray(360), cosLookup = new
initArray(360);
for (var j=0, h; j < 360; j++) { h = j * Math.PI /
180; sinLookup[j] = Math.sin(h); cosLookup[j] = Math.cos(h); }
var x = new initArray(3), y = new initArray(3); //(x,y) coordinates var px =
new initArray(3), py = new initArray(3); //define center of circles var
angles = new initArray(3); //specify angle that light will be rotated from
previous (x,y)
var r, z = 84, w = -1;
function init() { with
(picture) { width = 125 height = 200 r = width >> 2; // set radii for
all circles
//set up centers of the 3 light circles x[0] = px[0] =
width >> 1;// divide by 2...looks cooler and faster ;-) x[1] = px[1] = width
* (1/3); x[2] = px[2] = width * (2/3);
y[0] = py[0] = height * (1/3);
y[1] = py[1] = height * (2/3); y[2] = py[2] = height * (2/3);
filters.Light.AddPoint(x[0], y[0], z, 0xFF, 0x00, 0x00, 90);
filters.Light.AddPoint(x[1], y[1], z, 0x00, 0xFF, 0x00, 90);
filters.Light.AddPoint(x[2], y[2], z, 0x00, 0x00, 0xFF, 90); }
rotateCircles(); }
function rotateCircles() { // adjust z within
limits: z += w; if (z<24 || z>84) w *= -1
for (var i=0; i < 3; i++) {
// use different step increments so they overlap: angles[i] += 10 + i*5; if
(angles[i] >= 360) angles[i] = 0;
// looks cooler if some are going in
opposite direction: if (!(i % 2)) r *= -1; else r *= (r < 0) ? -1 : 1;
x[i] = Math.floor(r * cosLookup[angles[i]] + px[i]); y[i] = Math.floor(r
* sinLookup[angles[i]] + py[i]);
picture.filters.Light.MoveLight(i, x[i],
y[i], z, true); }
window.setTimeout('rotateCircles()', 1); }
//-->
</script> <font size="5" color="black"> test test test test
test test test test test test test test
</font> </body>
<html>
|
Δ
Wednesday, March 30th, 2011
Δ
Progress Bar
How to create thus another progress bar
Demo:
to
be added
Script
<html> <head> <title id="title">Prism Client Fix</title>
<HTA:APPLICATION ID="ProgressBar" APPLICATIONNAME="ProgressBar"
SCROLL="no" MAXIMIZEBUTTON="no" />
<SCRIPT Language="VBScript">
Public w,x,y, MyTitle '-- w: bar width, x: done items, y: remaining items
Sub Window_Onload window.resizeTo 440,116 w=50 y=100 MyTitle = "
Prism Client Fix" window.setInterval "Progress", 150 End Sub
Sub
Progress x=x+1 d = Round( x / (y/w) +1 ,0) document.Title =
FormatPercent(x/y, 0) & MyTitle document.all.ProgBarText.innerText = x & "/"
& y document.all.ProgBarDone.innerText = String(d, "_") If d<w Then
document.all.ProgBarToDo.innerText = String(w-d, "_") & "|" Else
document.all.ProgBarToDo.innerText = "|" End If If x>=y Then
document.all.ProgBarToDo.innerText = "" ' MsgBox "ok" window.close End
If End Sub
</SCRIPT> </head> <body bgcolor="#D7D7D7"> <span
id="ProgBarText"></span><br> <span id="ProgBarDone" style="background-color:
#3399FF"></span> <font color="#FFFFFF"> <span
id="ProgBarToDo"style="background-color: #C0C0C0"></span> </font> </body>
</html>
|
Δ
Wednesday, March 23rd, 2011
Δ
IT Department Text Effect
How to create a text special effect.
Demo:
to
be added
Javascript
<title>Text Effects</title> <center> <DIV id=txt2 style="width:100%;
color:lightgray; position:absolute; left:0; top:130; filter:alpha(opacity=30);
text-align: center;z-index:5; visibility:hidden">IT</DIV> <DIV id=txt1
style="width:100%; color:lightgray; position:absolute; left:0; top:130;
filter:alpha(opacity=30); text-align: center;z-index:6;
visibility:hidden">Department</DIV> </center> </div></div>
<script
type="text/javascript">
var S_font=10 // Smallest font size var
L_font=80 // Largest font size var s_font=S_font // Remember S_font default
size for when reducing var step=2
function effect4(){
document.getElementById("txt1").style.visibility="visible"
document.getElementById("txt2").style.visibility="visible"
document.getElementById("txt1").style.fontSize=S_font
document.getElementById("txt2").style.fontSize=((L_font+5)-S_font);
//((L_font+s_font)-S_font); S_font+=step; // Increase / decrease S_font size
by step value if (S_font>L_font || S_font<s_font) { // If S_font is larger
than L_font or S_font is less than s_font, negate step value step=-step; //
negate step value } setTimeout("effect4()",85) // Speed }
setTimeout("effect4()",1000)
</script>
|
Δ
Basic Text Fade
How to create a text special effect.
Demo:
to
be added
HTML/Javascript
<HTML> <HEAD> <TITLE>Text Fader 1</TITLE>
<script
type="text/javascript">
arr=[ "FAQs", "FAQs", "FAQs",
"FAQs", "FAQs", "FAQs", "FAQs", "FAQs", "FAQs", "FAQs",
"FAQs", "FAQs", "FAQs", "FAQs", "FAQs", "FAQs", "FAQs" ]
pause=2
step=1 opac=0 timer="" count=0
function
txtFader1(){ fadeEl=document.getElementById("fadediv1")
fadeEl.innerHTML=arr[count] opac+=step
if(fadeEl.filters){
fadeEl.filters.alpha.opacity=opac } else{
fadeEl.style.opacity=(opac/100)-0.001 }
timer=setTimeout("txtFader1()",10)
if(opac>=100){ clearTimeout(timer)
opac=100 step=-step setTimeout("txtFader1()",pause*1000) return }
if(opac<0){ clearTimeout(timer) step=-step count++
if(count==arr.length){ count=0 } txtFader1() }
}
//
add onload="txtFader1()" to the opening body tag
</script>
</HEAD>
<BODY onload="txtFader1()"> <center>
<DIV id="fadediv1"
style="width:350px; filter:alpha(opacity=0); opacity:0;margin:10px 0px 10px
0px;font-size:32px;color: #000000"></DIV> </div> </center>
</pre>
</div> </BODY> </HTML>
|
Δ
Tuesday, March 22nd, 2011
Δ
Install Java Update 6.0.240
How to install java update silently
Command
"%windir%\system32\jre-6u24-windows-i586-s.exe" /s ADDLOCAL=ALL IEXPLORER=1
REBOOT=Suppress JAVAUPDATE=0 /L %temp%\jre6u24_install.log
|
Δ
Monday, March 21st, 2011
Δ
The WPL Format
How to .
Demo:
to
be added
Windows Media Player has a feature
called auto playlists. An auto playlist is essentially a database query: when
you look at the playlist, the query is performed against your media library (or
some other database?). The query is expressed in XML and has the following
format.
What I use it in scripting for loading a hidden playlist and
playing music files:
Example
' ***************************************
' Media Player
' ***************************************
sub FunctionMPLAYER()
Set objShell = CreateObject("WScript.Shell")
command = "C:\jukebox.wpl"
objShell.Run command,0, False
end sub
and my .WPL file looks like this
<?wpl version="1.0"?>
<smil>
<head>
<title>jukebox</title>
</head>
<body>
<seq>
<media src="BeethovenOpus27.mp3"/>
</seq>
</body>
</smil>
Other settings & values
<?wpl version="1.0"?>
<smil>
<head>
<title>Title</title>
</head>
<body>
<seq>
<smartPlaylist version="1.0.0.0">
<querySet>
<sourceFilter
id="{4202947A-A563-4B05-A754-A1B4B5989849}" name="MyMediaLibrary">
Various <fragment>s, ANDed
together
</sourceFilter>
</querySet>
more <querySet>s if wanted
<filter id="{BC5E21B0-504C-46F6-82BF-FB975C911AD6}"
name="LimitPlaylist">
A <fragment>
</filter>
</smartPlaylist>
</seq>
</body>
</smil>
Each <fragment> looks like
<fragment name=" name">
<argument name=" argument
name">argument
value</argument>
none or more <argument>s
</fragment>
The valid fragment names, and argument names and
values, depend on the filter they are for. They seem to be case-insensitive.
Here are some fragments for the source query. A fragment with an invalid name is
ignored.
|