El sitio más completo sobre programación, recursos web y herramientas online para Webmasters
Fecha: 22/01/2003

imagen texto agrupados script

este javascript permite agrupar tanto una imagen con texto, de esa unión sale esto …


Código Javascript


<script type="text/javascript">
<!-- Beginning of JavaScript -
// CONFIGURATION:
// 1. Delete the DIV-block with the id "delethethistext". Save all the rest as HTML-file.
// 4. Configure the varibales of the first script-block.
// The second script block (below the body-tag) needs no configuration.
// Edit your messages. You can add as many messages a you like.
var message = new Array()
message[0]="Ese el primero de todo en uno combinando en una ventana. Tambien podés añadir textos y/o imagenes tantas veces como deseas."
message[1]="El tamaño de la imagen es a eleccion tuya. Cada mensaje puede estar enlazado."
message[2]="Cada 1 minuto se configura la velocidad, fuente, tamaño-fuente color-fuente, tamaño-ticker y efecto de transicion."
// The links of your messages. Be sure that you configure as many links as messages.
// If you don't want to link a message write '#' instead of an URL (see last sample).
var messageurl = new Array()
messageurl[0]="http://www.gamarod.com.ar"
messageurl[1]="http://www.interplastic.com.ar"
messageurl[2]="http://www.2knetwork.com.ar"
// The images for your messages.
var messageimg = new Array()
messageimg[0]="ejemplos/ej1.jpg"
messageimg[1]="ejemplos/ej2.jpg"
messageimg[2]="ejemplos/ejemplo3.gif"
// Alignment for each image in relation to its message-text (right or left)
var alignimg=new Array()
alignimg[0]="right"
alignimg[1]="left"
alignimg[2]="right"
// Alignment for message in relation to the margin of the messagebox
var alignmessage=new Array()
alignmessage[0]="right"
alignmessage[1]="left"
alignmessage[2]="left"
// target of the message-links (HTML conventions)
var target_url="_blank"
// The width of your ticker
var textwidth=240
// The height of your ticker
var textheight=100
// The borderwidth of your ticker
var borderwidth=0
// The size of the font (HTML3 conventions)
var font_size=1
// font-face
var font_face="Verdana"
// font-color
var font_color="black"
// background-color of the ticker
var bg_ticker="DDEE99"
// Final horizontal position of the messagebox: distance to the left margin of the window
var x_finalpos=10
// Final vertical position of the messagebox: distance to the top margin of the window
var y_finalpos=10
// Number of lamellas.
var x_slices=12
// Pause beween the messages (milliseconds)
var pause=2000
// Do not change the variables below this line
var imgpreload=new Array()
for (i=0;i<=messageimg.length-1;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=messageimg[i]
}
var i_loop=0
var i_message=0
var width_slice=Math.ceil(textwidth/x_slices)
var cliptop=0
var clipbottom=textheight
var i_clipright=1
var content=""
function initiate() {
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+message[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
if (document.all) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
var thiss=eval("document.all.s"+i+".style")
thiss.posLeft=x_finalpos
thiss.posTop=y_finalpos
}
i_message++
openlamellar()
}
if (document.layers) {
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
var thiss=eval("document.s"+i)
thiss.left=x_finalpos
thiss.top=y_finalpos
}
i_message++
openlamellarNN()
}
}
function openlamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellar()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellar()",2000)
}
}
function openlamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright<=width_slice) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright++
var timer=setTimeout("openlamellarNN()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("closelamellarNN()",2000)
}
}
function closelamellar() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.all.s"+i+".style")
thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellar()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("changeimage()",2000)
}
}
function closelamellarNN() {
clipleft=-width_slice
clipright=0
if (i_clipright>=0) {
for (i=0;i<=x_slices;i++) {
var thiss=eval("document.s"+i)
thiss.clip.left=clipleft
thiss.clip.right=clipright
thiss.clip.top=cliptop
thiss.clip.bottom=clipbottom
clipleft+=width_slice
clipright=clipleft+i_clipright
}
i_clipright--
var timer=setTimeout("closelamellarNN()",20)
}
else {
clearTimeout(timer)
var timer=setTimeout("changeimageNN()",2000)
}
}
function changeimage() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+message[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("s"+i)
thisinners.innerHTML=content
}
i_message++
openlamellar()
}
function changeimageNN() {
content=""
if (i_message>message.length-1) {i_message=0}
content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
content+="<a href="+message[i_message]+" target="+target_url+">"
content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
content+=message[i_message]
content+="</font></a></td></tr></table>"
for (i=0;i<=x_slices;i++) {
var thisinners=eval("document.s"+i+".document")
thisinners.write(content)
thisinners.close()
}
i_message++
openlamellarNN()
}
// - End of JavaScript - -->
</script>
<style>
.s {
position:absolute;
left:-5000px;
topt:-5000px;
}
A {
text-decoration:none;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="000000" onLoad="initiate()">
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=x_slices;i++) {
document.write("<span id='s"+i+"' class='s'></span>")
}
// - End of JavaScript - -->
</script>

imagen texto agrupados script Categoría: Javascript, Efectos imagenes

Compartir imagen texto agrupados script en Facebook Twitter MySpace del.icio.us fresqui Meneame


Scripts Similares:

» Efecto Burbujas javascript
» Mover imagen javascript
» script cambiar imagen
» Precarga de Imagenes con javascript
» bloquear boton derecho del mouse con javascript
» banner rotator javascript
Ver el perfil de Gabriel Marcelo Rodriguez en LinkedIn

Privacidad ּ Publicidad ּ Prensa ּ Premios ּ Colaborar ּ Enlazarnos ּ Mapa del Sitio ּ Aviso legal ּ Boletín ּ Contacto
2001 - 2011 | Sitio Sitio creado y mantenido por Gabriel Marcelo Rodriguez
Hosting de alta calidad a bajo costo Neolo.com.ar