Slideshow with zoom-in-zoom-out-animation
Slideshow with great transitoon effect. Each image has a JavaScript link of its own. Netscape-users will see a simple image-rotation-ef... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place HTML below in your BODY section
HTML
Code:
<BODY onload=initiate()>
<SCRIPT>
<!-- Beginning of JavaScript -
// Slideshow with zoom-in-zoom-out-animation
// CONFIGURATION:
// 1. Create your images (gif or jpg). They should have the same width.
// Put those images in the same directory as the HTML-file.
// You can add as many images as you like.
// 2. Copy the script-block and paste it into head-section of your HTML-file..
// 3. Copy the span-blocks with the id "imgcontainer" into the body-section
// of your HTML-file.
// 4. Insert 'onLoad="initiate()"' into the body tag.
// 5. Configure the varibales below.
// The width of your images (pixels). All pictures should have the same width.
var imgwidth=256
// The horizontal and vertical position of the images (pixels).
var pos_left=10
var pos_top=10
// The name of your images. You may add as many images as you like.
var imgname=new Array()
imgname[0]="logojs.gif"
imgname[1]="photo3.jpg"
imgname[2]="photo4.jpg"
// Where should those images be linked to?
// Add an URL for each image.
// If you don't want to add an URL just write '#' instead of the URL.
var imgurl=new Array()
imgurl[0]="http://javascriptbank.com"
imgurl[1]="http://javascriptbank.com"
imgurl[2]="http://javascriptbank.com"
// This block will preload your images. Do not edit this block.
var imgpreload=new Array()
for (i=0;i<=imgname.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=imgname[i]
}
// Standstill-time between the images (microseconds).
var pause=2000
// Speed of the stretching and shrinking effect. More means slower.
var speed=20
// This variable also affects the speed (the length of the step between each inmage-frame measured in pixels). More means faster.
var step=10
// Do not edit the variables below
var i_loop=0
var i_image=0
function stretchimage() {
if (i_loop<=imgwidth) {
if (document.all) {
imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>"
}
i_loop=i_loop+step
var timer=setTimeout("stretchimage()",speed)
}
else {
clearTimeout(timer)
var timer=setTimeout("shrinkimage()",pause)
}
}
function shrinkimage() {
if (i_loop>-step) {
if (document.all) {
imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>"
}
i_loop=i_loop-step
var timer=setTimeout("shrinkimage()",speed)
}
else {
clearTimeout(timer)
changeimage()
}
}
function changeimage() {
i_loop=0
i_image++
if (i_image>imgname.length-1) {i_image=0}
var timer=setTimeout("stretchimage()",pause)
}
function initiate() {
if (document.all) {
document.all.imgcontainer.style.posLeft=pos_left
document.all.imgcontainer.style.posTop=pos_top
changeimage()
}
if (document.layers) {
document.imgcontainer.left=pos_left
document.imgcontainer.top=pos_top
rotatenetscape()
}
}
function rotatenetscape() {
document.imgcontainer.document.write("<a href='"+imgurl[i_image]+"' target='_blank'><img src='"+imgname[i_image]+"' border='0'></a>")
document.imgcontainer.document.close()
i_image++
if (i_image>imgname.length-1) {i_image=0}
var timer=setTimeout("rotatenetscape()",pause*2)
}
document.write("<div id=\"roof\" style=\"position:relative\">")
document.write("<div id=\"imgcontainer\" style=\"position:absolute;top:0px;left:0px\"></div>")
document.write("</div>")
// - End of JavaScript - -->
</SCRIPT>
</BODY>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
Helpful JavaScript resources for Designers
Web Design - a task that requires the creativity and a lot of time, to create the high quality products. However, in the environment of modern web nowadays, the Internet produced a lot of libraries, u... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
10 Tiny JavaScript Snippets for Good Beginners
Yes, as the title of this JavaScript tutorial said, these JavaScript tips and tricks are so tiny and simple for operating, but sometimes we (web developers and web programmers/coders) forget about the... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Double fading Image Scroller 2.03
Image scroller with unique fade zones. Add a comment and JavaScript link to each picture. Easy configuration of images, font-attributes and fade zones.... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Place HTML below in your BODY section
HTML
Code:
<SCRIPT>
// Image Scroller 2.03 with double-fade effect
// URLs of slides
var slideurl=new Array("logojs.gif","photo1.jpg","photo2.jpg","photo3.jpg")
// comments displayed below the slides
var slidecomment=new Array("JavaScriptBank.com","JavaScriptBank.com","JavaScriptBank.com","JavaScriptBank.com")
// links for each slide
var slidelink=new Array("http://JavaScriptBank.com","http://JavaScriptBank.com","http://JavaScriptBank.com","http://JavaScriptBank.com")
// targets of the links. Allowed values: "_parent", "_top", "_blank", "_self"
var slidetarget=new Array("_blank","_blank","_blank","_blank")
// the width of the slideshow (pixels)
var scrollerwidth=200
// the height of the slideshow (pixels)
var scrollerheight=200
// width of the transparent zones (pixels)
var translayerszone=40
// font-attributes for the comments
var slidefont="Arial"
var slidefontcolor="blue"
var slidefontsize="2"
// background-color of webpage
var pagebgcolor="#FFFFFF"
// do not edit below this line
var translayerswidth=1
var translayersmax=Math.floor(translayerszone/translayerswidth)
var translayersleftpos=0
var translayersopacity=100
var translayersfactor=100/translayersmax
var translayerswidthall=translayersmax*translayerswidth
var allpicturewidth
var distancepictopic=0
var scrollerleft=0
var scrollertop=0
var pause=20
var step=2
var newstep=step
var clipleft,clipright,cliptop,clipbottom
var i_picture=0
var timer
var picturecontent=""
var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0
var ie=document.all?1:0
var browserinfos=navigator.userAgent
var opera=browserinfos.match(/Opera/)
var preloadedimages=new Array()
for (i=0;i<slideurl.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=slideurl[i]
}
function init() {
if (ie) {
allpicturewidth=document.all.picturediv.offsetWidth
document.all.picturediv.style.posTop=scrollertop
document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth
clipleft=0
clipright=0
cliptop=0
clipbottom=scrollerheight
document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.all.picturediv.style.visibility="visible"
scrollpicture()
}
if (ns6) {
allpicturewidth=document.getElementById('emptypicturediv').offsetWidth
document.getElementById('picturediv').style.top=scrollertop
document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth
clipleft=0
clipright=0
cliptop=0
clipbottom=scrollerheight
document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.getElementById('picturediv').style.visibility="visible"
scrollpicture()
}
if (ns4) {
allpicturewidth=document.roof.document.picturediv.document.width
document.roof.document.picturediv.top=scrollertop
document.roof.document.picturediv.left=scrollerleft+scrollerwidth
document.roof.document.picturediv.clip.left=0
document.roof.document.picturediv.clip.right=0
document.roof.document.picturediv.clip.top=0
document.roof.document.picturediv.clip.bottom=scrollerheight
document.roof.document.picturediv.visibility="visible"
scrollpicture()
}
}
function scrollpicture() {
if (ie) {
if (document.all.picturediv.style.posLeft>=scrollerleft-allpicturewidth) {
document.all.picturediv.style.posLeft-=step
clipright+=step
if (clipright>scrollerwidth) {
clipleft+=step
}
document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
var timer=setTimeout("scrollpicture()",pause)
}
else {
resetposition()
}
}
if (ns6) {
if (parseInt(document.getElementById('picturediv').style.left)>=scrollerleft-allpicturewidth) {
document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-step
clipright+=step
if (clipright>scrollerwidth) {
clipleft+=step
}
document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
var timer=setTimeout("scrollpicture()",pause)
}
else {
resetposition()
}
}
if (ns4) {
if (document.roof.document.picturediv.left>=scrollerleft-allpicturewidth) {
document.roof.document.picturediv.left-=step
document.roof.document.picturediv.clip.right+=step
if (document.roof.document.picturediv.clip.right>scrollerwidth) {
document.roof.document.picturediv.clip.left+=step
}
var timer=setTimeout("scrollpicture()",pause)
}
else {
resetposition()
}
}
}
function onmsover() {
step=0
}
function onmsout() {
step=newstep
}
function resetposition() {
if (ie) {
document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth
clipleft=0
clipright=0
document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
scrollpicture()
}
if (ns6) {
allpicturewidth=document.getElementById('emptypicturediv').offsetWidth
document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth
clipleft=0
clipright=0
document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
scrollpicture()
}
if (ns4) {
document.roof.document.picturediv.left=scrollerleft+scrollerwidth
document.roof.document.picturediv.clip.left=0
document.roof.document.picturediv.clip.right=0
scrollpicture()
}
}
picturecontent=""
picturecontent+="<table cellpadding=2 cellspacing=0>"
picturecontent+="<tr>"
for (i=0;i<=slideurl.length-1;i++) {
picturecontent+="<td>"
picturecontent+="<a href=""+slidelink[i]+"" target=""+slidetarget[i]+"" onMouseOver="javascript:onmsover()" onMouseOut="javascript:onmsout()">"
picturecontent+="<img src=""+slideurl[i]+"" border=0></a>"
picturecontent+="</td>"
}
picturecontent+="</tr>"
picturecontent+="<tr>"
for (i=0;i<=slideurl.length-1;i++) {
picturecontent+="<td>"
picturecontent+="<font face=""+slidefont+"" color=""+slidefontcolor+"" size="+slidefontsize+">"
picturecontent+=slidecomment[i]
picturecontent+="</font>"
picturecontent+="</td>"
}
picturecontent+="</tr>"
picturecontent+="</tr></table>"
if (ie || ns6) {
document.write('<div style="position:relative;width:'+scrollerwidth+'px;height:'+scrollerheight+'px;overflow:hidden">')
document.write('<div id="picturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>')
if (ie && !opera) {
for (i=0;i<=translayersmax;i++) {
document.write('<span ID="trans'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> </span>')
translayersleftpos+=translayerswidth
translayersopacity-=translayersfactor
}
translayersleftpos=scrollerwidth-translayersleftpos
for (ii=0;ii<=translayersmax;ii++) {
document.write('<span ID="trans'+ii+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> </span>')
translayersleftpos+=translayerswidth
translayersopacity+=translayersfactor
}
}
if (ns6 && !opera) {
for (i=0;i<=translayersmax-1;i++) {
document.write('<span ID="transleft'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';-moz-opacity:'+translayersopacity/100+';overflow:hidden"> </span>')
translayersleftpos+=translayerswidth
translayersopacity-=translayersfactor
if (translayersopacity<0) {translayersopacity=0.001}
}
translayersleftpos=scrollerwidth-translayersleftpos
translayersopacity=0.001
for (i=0;i<=translayersmax-1;i++) {
document.write('<span ID="transright'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;background-color:'+pagebgcolor+';-moz-opacity:'+translayersopacity/100+';"> </span>')
translayersleftpos+=translayerswidth
translayersopacity+=translayersfactor
}
}
document.write('</div>')
document.write('<div id="emptypicturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>')
window.onload=init
}
if (ns4) {
document.write('<ilayer name="roof" width='+scrollerwidth+' height='+scrollerheight+'>')
document.write('<layer name="picturediv" width='+scrollerwidth+' height='+scrollerheight+' visibility=hide>'+picturecontent+'</layer>')
document.write('</ilayer>')
window.onload=init
}
</SCRIPT>
Rich Content JavaScript DOMTooltips
Are you looking for a JavaScript tooltip which can make your additional content become more beautiful when the mouse is over it, for your anchors? Then this is a JavaScript you should try, <b>DOMToolt... detail at JavaScriptBank.com - 2.000+ free JavaScript codes
How to setup
Step 1: Copy & Paste HTML code below in your BODY section
HTML
Code:
<link rel="stylesheet" href="domtooltips.css" type="text/css" />
<script src="domtooltips.js" type="text/javascript"></script>
<p>Domtooltips is created by <a href="http://rubensargsyan.com/" target="_blank"><span class="domtooltips" title="Ruben Sargsyan is a web developer from Yerevan, Armenia.">Ruben Sargsyan</span></a>.</p>
<p><span class="domtooltips" title="This is the logo of Ruben Sargsyan's personal website."><img src="logo.jpg" width="190" height="160" alt="Logo"></span></p>
<script type="text/javascript"> load_domtooltips(); </script>
Step 2: must download files below
Files
domtooltips.css
domtooltips.js