Goodies To Go! Newsletter #365
http://www.htmlgoodies.com/introduction/newsletter_archive/goodiestogo/article.php/3570046/Goodies-To-Go-Newsletter-365.htm (Back to article)
Goodies to Go (tm)
November 29, 2005 -- Newsletter # 365
http://www.internet.com
************************************************************
Featured this week:
* Q & A Goodies
* News Goodies
* Feedback Goodies
* Windows Tech Goodie of the Week
* And Remember This...
***********************************
Questions are taken from submissions to our Community
Mentors. You can ask a Mentor a question by going to
http://www.htmlgoodies.com/mentors/
<html><head>
<script type="text/javascript">
var num=1 img1 = new Image (150,150)
img1.src = "0.gif" img2 = new Image (150,150)
img2.src = "1.gif" img3 = new Image (150,150)
img3.src = "2.gif"
function startshow()
{
num=num+1
if(num<4)
{
document.mypic.src=eval('img'+num+'.src')
anim=setTimeout('startshow()',3000)
}
else
{
num=0
clearTimeout(anim)
document.mypic.src=img1.src
}
}
</script>
</head>
<body>
<center>
<img src="0.gif" name="mypic" border=0 alt="My Image">
<br>
<a href="JavaScript:startshow()">Display animation</a> </center> </body> </html>
setTimeout, a method of the window object, basically delays the execution of a function or statement until the specified time has passed. The basic syntax of this function is:
setTimeout("expression", delaytime)
"expression" is the function/statement you want delayed, and delaytime is the delay time, in milliseconds.
I also use clearTimeout to stop the animation once it reaches the end of the images array.
A. You could try using document.write() to create your text links. For example:
document.write("<a href='somepage.html'>Click Me</a>")
Just make sure you use single quotes within double quotes or vice versa. Also you might want to place the script within a div to help position it.
[Also, take a look at the Goodies Thoughts sections in: http://www.htmlgoodies.com/letters/230.html and http://www.htmlgoodies.com/letters/231.html -- Ed.]
Q. I am a beginner working in the Primers and I am having a problem with images. I work with Windows XP. When I open a page in the browser, the image appears as a little box with a red "x" in the middle. (code sample and description provided)
[Where your HTML code doesn't specify a pathname, the image must be in the same folder as the HTML page file. - Ed.]
Q. How do I link parts of the same image to different urls?
http://www.htmlgoodies.com/tutorials/image_maps/
<html><head><title>Image and Link Slide Show</title>
<SCRIPT LANGUAGE="JavaScript">
var a=0
// Enter your images Here along with the directory if need be.
var imgs=new Array()
imgs[0]="owls3.jpg"
imgs[1]="hawks2.jpg"
imgs[2]="pic221.jpg"
imgs[3]="eagle1.jpg"
// Array used for preloading
var myimages=new Array()
// Do the preload
for(i=0;i<imgs.length;i++)
{
myimages[i]=new Image()
myimages[i].src=imgs[a]
}
// Enter your URLS and what you want to go in the ALT property.
// This is so when they mouse over the image, there will be a small description of the Image or URL.
// Make sure you separate them with an ampersand "&"
// so that the script can separate them out before writing out the link.
var urls=new Array()
urls[0]="http://www.requestcode.com&Requestcode"
urls[1]="http://www.javascriptkit.com&Javascriptkit"
urls[2]="http://www.dynamicdrive.com&Dynamic Drive"
urls[3]="http://www.htmlgoodies.com&HTML Goodies"
// This is the function that displays the images and links.
// You should not have to modify it.
function Doimglink()
{
if(a>imgs.length-1)
{a=0}
if(a<0)
{a=imgs.length-1}
newurls=urls[a].split("&")
if(document.layers)
{
document.mydiv.document.write("<A HREF='"+newurls[0]+"'><IMG
SRC='"+imgs[a]+"' BORDER='0' ALT='"+newurls[1]+"'></A>")
document.mydiv.document.close()
}
if(document.getElementById)
{
elm=document.getElementById("mydiv")
elm.innerHTML="<A HREF='"+newurls[0]+"'><IMG SRC='"+imgs[a]+"'
BORDER='0' TITLE='"+newurls[1]+"'></A>"
}
}
// function used to display random image
function rannum()
{
len=imgs.length // how many entries in the array
prev=a // Save the previous image index
a=Math.round(Math.random()*(len-1))
// If the current image equals the previous image,
// add one to get a different image.
if(a==prev)
{a++}
}
window.onload=Doimglink
// In the DIV below you may have to add the top and left properties
// to the style tag to position it correctly in the window.
// You must keep it positions as absolute for it to work in NS4.0+ browsers.
</head>
<body onLoad="Doimglink()">
<CENTER><H1>Manual Slide Show With Links</H1>
<DIV ID='mydiv' STYLE="position:absolute;top:120;left:200"></DIV>
<DIV ID='ctrldiv' STYLE="position:absolute;top:120;left:100">
<A HREF="javascript:a++;Doimglink()">Next Image</A> <BR>
<A HREF="javascript:a--;Doimglink()">Previous Image</A> <BR>
<A HREF="javascript:rannum();Doimglink()">Random Image</A>
</DIV>
</body>
</html>
Discussion Goodies
***********************************
http://www.webdeveloper.com/forum/showthread.php?threadid=86733
http://www.webdeveloper.com/forum/showthread.php?threadid=86693
http://www.webdeveloper.com/forum/showthread.php?threadid=86726
http://www.webdeveloper.com/forum/showthread.php?threadid=86681
http://www.webdeveloper.com/forum/showthread.php?threadid=86694
***********************************
[November 29, 2005] Online gifting could provide all the info a predator could wish for.
Read the article:
http://www.internetnews.com/ec-news/article.php/3566901
Firefox Upgrade Near
[November 29, 2005] UPDATED: The organization will launch the first major update to its browser since the official release of version 1.0 little more than a year ago.
Read the article:
http://www.internetnews.com/dev-news/article.php/3567051
Real-Time Linux Inside Defense Industry
[November 29, 2005] A U.S. Army program will use real time Linux system for simulation testing despite concerns about the GPL license.
Read the article:
http://www.internetnews.com/dev-news/article.php/3567086
Cingular, Orange Pact 'Eases Pain'
[November 29, 2005] The U.S. and U.K. carriers partner to make it easier for international companies to manage their services.
Read the article:
http://www.internetnews.com/bus-news/article.php/3567161
U.K. Warms to Sun's Grid Storage
[November 29, 2005] Sun creates two new grid storage utility services and agrees to dole out 2 million computing CPUs.
Read the article:
http://www.internetnews.com/ent-news/article.php/3567016
Skype Takes Another EBay Exec
[November 29, 2005] Henry Gomez will spearhead the VoIP service's North American expansion.
Read the article:
http://www.internetnews.com/bus-news/article.php/3567026
Wi-Fi Still Booming
[November 29, 2005] Sales of chipsets that enable wireless connectivity topped 100 million units this year.
Read the article:
http://www.internetnews.com/stats/article.php/3566911
NetGear to Settle Speed Suit
[November 28, 2005] The wireless equipment maker will give discounts on new gear and pay up to $700,000 in legal bills.
Read the article:
http://www.internetnews.com/bus-news/article.php/3566881
EBay in High Court Over Patent Dispute
[November 28, 2005] UPDATED: Justices agree to hear long patent battle between the online auctioneer and MercExchange.
Read the article:
http://www.internetnews.com/bus-news/article.php/3566701
Retailers Brace For 'Cyber Monday' Onslaught
[November 28, 2005] Consumers hit the online shopping trail.
Read the article:
http://www.internetnews.com/ec-news/article.php/3566736
Feedback Goodies
***********************************
If you would like to comment on the newsletter or expand/improve on something you have seen in here, you can now send your input to:
Windows Tech Goodie of the Week
***********************************
*** AND ***
ElseIf ASP.NET Sample Code
and this difference can be very useful. It starts out like any other "If Then," but there's no space between the "Else" and the next "If."
*** AND ***
Using Visual Studio .NET Wizards to Create an N-Tiered Application - Part 3
And Remember This ...
***********************************
1948 Australia's First Car Unveiled
With Australia's Prime Minister Ben Chifley among the 1,200 or so in attendance,
the first car manufactured entirely in Australia was unveiled on this day in
1948. Although its official designation was the 48-215, it was known as the
Holden FX. General Motors - Holden Automotive had accepted the Australian
government's 1945 challenge for Australian auto parts makers to produce an
all-Australian car. The FX was their response, and proved to be a great success,
selling over 100,000 cars in the first five years of production. General Motors
Holden Automotive produced several more very successful models, including the
Torana and Commodore, enabling their Lion and Stone emblem to be exported around
the world, as well as selling well at home. In 1994 the company officially
adopted "Holden" as its company name. Their success continues today.
Today was also the day that in: 1877 Thomas Edison demonstrated the
phonograph; 1916 the US declared marshal law in the Dominican Republic;
1944 John Hopkins hospital performed the first open heart surgery; 1945
the Yugoslavian monarchy was abolished as the country declared itself a
republic; 1947 the UN general assembly partitioned Palestine between
Arabs and Jews; 1951 First underground atomic explosion, at Frenchman
Flat, Nevada; 1961 Mercury-Atlas rocket carried a chimp ("Enos") into
orbit; 1963 The Beatles released "I Want to Hold Your Hand"; 1964
the Roman Catholic Church in the US replaced Latin with English; 1968
John & Yoko Lennon released their first album "Two Virgins" in the UK; 1971
the first pro golf championship at Walt Disney World in Orlando Florida; 1987
Korean Air Boeing 707 en route to Seoul disappeared off Burma, 115 on board were
all lost; 1994 Russia bombed Grozny, the capitol of Chechnya;
Born today were: in 1803 color shift discoverer Christian Doppler
(Doppler Effect); 1832 author Louisa May Alcott (Little Women); 1849
English diode inventor Sir Ambrose Flemming; 1932 actress Diane Ladd;
1933 author Dr. David Reuben; 1933 blues singer John Mayall; 1940
jazz musician Chuck Mangione; 1949 comedian Gary Chandling; 1955
Canadian comedian Howie Mandel; 1959 actor Charles Grant; 1960
actress Cathy Moriarty; 1961 actress Kim Delaney; 1963 actor
Andrew McCarthy; 1968 musician Jonathan Raleigh Knight;