Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/04/2002, 02:35
TIO-PEPE
 
Fecha de Ingreso: marzo-2002
Mensajes: 46
Antigüedad: 23 años
Puntos: 0
Re: Script o algo para poner gif en formulario

una vez hice unos ejemplos de esto y otras cosas con el style=background. aquí puedes encontrar los que buscas, espero que te sirva. p.d. imagen.gif debe existir.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>


<script>
function ej1(){
tb.style.background = "beige none no-repeat top center"
}

function ej2(){
//tb.style.background = "transparent none no-repeat top center"
tb.style.backgroundColor = "red"
tb.style.backgroundImage = "url(create.gif)"
tb.style.backgroundRepeat = "repeat"
}

function ej3(){
//Ojo: Hay que hacer primero el ej1 porque sino esto solo tira la segunda vez
// puede ser por el orden en que hay que cargar las propiedades o porque haya que inicializar todas de esa manera
tb.style.backgroundColor = "transparent"
tb.style.backgroundImage = "url(create.gif)"
tb.style.backgroundRepeat = "no-repeat"
tb.style.backgroundPositionX ="280"
tb.style.backgroundPositionY ="40"
}

</script>

</HEAD>
<BODY onload="ej1()">

<TABLE id=tb name=tb WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD>asdf</TD>
<TD>adsf</TD>
<TD>adsf</TD>
<TD>afds</TD>
<TD>safd</TD>
<TD>fdsa</TD>
<TD>afds</TD>
<TD>afds</TD>
</TR>
<TR>
<TD>asdf</TD>
<TD>adsf</TD>
<TD>adsf</TD>
<TD>afds</TD>
<TD>safd</TD>
<TD>fdsa</TD>
<TD>afds</TD>
<TD>afds</TD>
</TR>
<TR>
<TD>asdf</TD>
<TD>adsf</TD>
<TD>adsf</TD>
<TD>afds</TD>
<TD>safd</TD>
<TD>fdsa</TD>
<TD>afds</TD>
<TD>afds</TD>
</TR>
<TR>
<TD>asdf</TD>
<TD>adsf</TD>
<TD>adsf</TD>
<TD>afds</TD>
<TD>safd</TD>
<TD>fdsa</TD>
<TD>afds</TD>
<TD>afds</TD>
</TR>

</TABLE>

<input value=background type=button onclick= "ej1()">
<input value="color, image y repeat" type=button onclick= "ej2()" id=button1 name=button1>
<input value="posicionX y position Y" type=button onclick= "ej3()" id=button2 name=button2>
</BODY>
</HTML>

<img src="http://www.imasur.com/fotos-imasur/tiopepe.jpg">
<img src="http://www.ac-nantes.fr/peda/disc/lv/espagnol/images/madrid3/vi082f.jpg">