Foros del Web » Programando para Internet » Javascript »

Ayuda con Dos JavaScript

Estas en el tema de Ayuda con Dos JavaScript en el foro de Javascript en Foros del Web. Necesito que estos dos codigos se activen en mi pagina: 1.- Reloj en el cursor <SCRIPT language=JavaScript> dCol="#FF0000";//date colour. fCol="#0000FF";//face colour. sCol="#FF0000";//seconds colour. mCol="#FF0000";//minutes colour. ...
  #1 (permalink)  
Antiguo 15/11/2009, 18:11
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Ayuda con Dos JavaScript

Necesito que estos dos codigos se activen en mi pagina:
1.- Reloj en el cursor

<SCRIPT language=JavaScript>
dCol="#FF0000";//date colour.
fCol="#0000FF";//face colour.
sCol="#FF0000";//seconds colour.
mCol="#FF0000";//minutes colour.
hCol="#FF0000";//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;

//Alter nothing below! Alignments will be lost!

d=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEV ES","VIERNES","DOMINGO");
m=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JU NIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVI EMBRE","DICIEMBRE");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a +';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a +';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;fo nt-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;fo nt-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;fo nt-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromM ouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove =Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
}
for (i=0; i < H.length; i++){
var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < M.length; i++){
var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < S.length; i++){
var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < D.length; i++){
var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
}
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
</SCRIPT>
  #2 (permalink)  
Antiguo 15/11/2009, 18:15
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

y este otro.-

Texto parpadeante.-

<span id="theText" style="width:100%">
<h3 align="center"><font color="#3a6ca3"><font size="+5">CREATUPROPIAWEB</font>
</font><font color="#666666">
<script> // ^-the text that will be displayed
<!--
//can be edited from here
var from = 5; //the animation start value
var to = 11; //the animation end value
var delay = 55; //the animation speed
var glowColor = "red"; //the first color
var glowColor2 = "orange"; //the second color
var glowColor3 = "yellow"; //the third color
var glowColor4 = "lime"; //4th color
var glowColor5 = "blue"; //5th color
var glowColor6 = "magenta"; //last color
//no more editing
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
}
//Copyright (c) 2001 Coyotee Labs Romania for more scripts
function textPulseUp2()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
}
function textPulseDown2()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
}
function textPulseUp3()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor5 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
}
function textPulseDown3()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script></font></h3></span>

Es que necesito que me digan como le hago para poner los dos, es que cuando pongo los dos namas se ve bien el del cursor y el del texto parpadeante no(se queda fijo) y cuando quito el del reloj se ve bien el del texto.

P.D: perdon por poner dos mensajes
  #3 (permalink)  
Antiguo 15/11/2009, 18:37
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

por favor, encierra el codigo entre los bbcode [code] codigo aqui [/code]. forosdelweb a veces tiene un fallo y le incluye un espacio arbitrariamente al contenido. anda y editalo para que otros te puedan ayudar.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #4 (permalink)  
Antiguo 16/11/2009, 13:20
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Ayuda con Dos JavaScript

Reloj en el cursor.-

Código:
<SCRIPT language=JavaScript>
dCol="#FF0000";//date colour.
fCol="#0000FF";//face colour.
sCol="#FF0000";//seconds colour.
mCol="#FF0000";//minutes colour.
hCol="#FF0000";//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;

//Alter nothing below! Alignments will be lost!

d=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","DOMINGO");
m=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
 var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
 F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
 F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
 }
for (i=0; i < H.length; i++){
 var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
 HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
 HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
 }
for (i=0; i < M.length; i++){
 var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
 ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
 ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
 }
for (i=0; i < S.length; i++){
 var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
 SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
 SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
 }
for (i=0; i < D.length; i++){
 var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
 DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
 DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
 }
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
</SCRIPT>
Texto parpadeante.-

Código:
<span id="theText" style="width:100%"> 
<h3 align="center"><font color="#3a6ca3"><font size="+5">Mi Pagina</font>
 </font><font color="#666666">
 <script>              //     ^-the text that will be displayed
<!--
//can be edited from here
var from = 5;                       //the animation start value
var to = 11;                        //the animation end value
var delay = 55;                     //the animation speed
var glowColor = "red";              //the first color
var glowColor2 = "orange";          //the second color
var glowColor3 = "yellow";          //the third color
var glowColor4 = "lime";            //4th color
var glowColor5 = "blue";            //5th color
var glowColor6 = "magenta";         //last color
//no more editing
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
}
//Copyright (c) 2001 Coyotee Labs Romania
//This script can be used freely as long as all copyright messages are
//intact.()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
}
function textPulseDown2()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
}
function textPulseUp3()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor5 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
}
function textPulseDown3()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script></font></h3></span>
Ahi estan zerokilled, espero su ayuda
  #5 (permalink)  
Antiguo 18/11/2009, 22:22
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: Ayuda con Dos JavaScript


Porque no me han contestado aun ???

Necesito de su ayuda porque mi pagina tiene que andar arriba en la proxima semana...

Porfavor, ayudenme !!!
  #6 (permalink)  
Antiguo 18/11/2009, 23:06
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

disculpa, tenia en conciencia que habia perdido un mensaje y no sabia en que foro estaba pero ya lo encontre gracias a ti. primero mencionar que este codigo solo te va a funcionar en iexplorer. asi lo asumo porque solo lo comprobe en firefox e iexplorer. localiza la siguiente linea en tu codigo,
Código:
//Copyright (c) 2001 Coyotee Labs Romania
y a partir de esa linea elimina (o comenta, como quieras hacerlo) las primeras tres ocurrencias de return. fue todo lo que hice.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #7 (permalink)  
Antiguo 19/11/2009, 19:25
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Ayuda con Dos JavaScript

Gracias por contestar ZeroKilled, pero me lo explicarias mas detallado, es que no te entiendo o me podrias poner el codigo ya modificado como tu me dices, te lo agradeceria muchisimo, porfavor, si no es tanta molestia

Espero tu respuesta...
  #8 (permalink)  
Antiguo 19/11/2009, 19:43
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

no se que tan dificil era, pero te voy a dejar un poco de trabajo. el siguiente codigo ya esta modificado, fijate la porcion en rojo.

Código:
//Copyright (c) 2001 Coyotee Labs Romania
//This script can be used freely as long as all copyright messages are
//intact.()
{
if (!document.all)
//return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp2()',delay);
//return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown2()',delay);
//return 0;
}
}
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #9 (permalink)  
Antiguo 19/11/2009, 19:50
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

Zerokilled...
Ups!!... Me enredaste mas


Que debo de hacer, borrar esas lineas o ponerles las diagonales que le pusiste, es que esas diagonales no me aparecen en el codigo y me imagino que tu se las pusiste, verdad ???
  #10 (permalink)  
Antiguo 19/11/2009, 20:15
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

cualquiera de las dos, puedes borrarlas, o ponerle las dos diagonales. las diagonales significan comentario y el interprete de javascript lo ignora, o sea, no lo interpreta como codigo para procesar. y si, las puses para que vieras exactamente donde se hizo el cambio, y que de hecho fue lo mismo que te explique en las instrucciones anteriores, comentar o borrar esas lineas.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #11 (permalink)  
Antiguo 19/11/2009, 20:20
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

Asi esta bien...


Código:
<span id="theText" style="width:100%"> 
<h3 align="center"><font face="BRUSH SCRIPT MT" color="#FFFFFF"><font size="6">Modulo II.- Creación De Productos Multimedia A Traves De Software De Diseño</font>
 </font><font color="#666666">
 <script>              //     ^-the text that will be displayed
<!--
//can be edited from here
var from = 5;                       //the animation start value
var to = 11;                        //the animation end value
var delay = 55;                     //the animation speed
var glowColor = "red";              //the first color
var glowColor2 = "orange";          //the second color
var glowColor3 = "yellow";          //the third color
var glowColor4 = "black";           //4th color
var glowColor5 = "blue";            //5th color
var glowColor6 = "lima";            //last color
//no more editing
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
}
//Copyright (c) 2001 Coyotee Labs Romania
//This script can be used freely as long as all copyright messages are
//intact. Visit for more scripts
function textPulseUp2()
{
if (!document.all)
//return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp2()',delay);
//return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown2()',delay);
//return 0;
}
}
function textPulseDown2()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
}
function textPulseUp3()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor5 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
}
function textPulseDown3()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script></font></h3></span>
Asi lo meto en Dreamweaver 8????
  #12 (permalink)  
Antiguo 19/11/2009, 20:26
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

esto va ser la odisea... : no por lo que has preguntado, nada que ver. sino porque ahora mismo me fijo que el codigo que has mostrado es un tanto diferente al que yo copie y de ahi que me llevara hacer las modificaciones que te indique. pero en principio fue un error tuyo al colocar el codigo dentro de los bbcode [code][/code] .

y si, supongo que eso lo pones en Dreamweaver desde el panel de codigo, no me preguntes como porque yo no uso DW.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #13 (permalink)  
Antiguo 19/11/2009, 20:30
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

y eso quiere decir que ???
  #14 (permalink)  
Antiguo 19/11/2009, 20:32
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

que lo mas seguro la modificacion que hice corrompera alguna funcionalidad del codigo. y que la proxima vez copies y pegues bien el codigo porque ahora hay que volver a analizar el codigo. cuando es mucho codigo, por lo general paso de estos temas. ¿se puede saber de donde sacastes el codigo?
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #15 (permalink)  
Antiguo 19/11/2009, 20:34
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

es que mira, en el codigo aparecen unas web´s(URL),y al momento de que las pongo aqui me dice que no puedo compartir direcciones(o algo asi), entonces como le hago para pasartelos bien ???
  #16 (permalink)  
Antiguo 19/11/2009, 20:36
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

a todas las URL, elimina http://www. de modo que solo quede el dominio y las rutas, por ejemplo google.com. y por favor, copialo todo en un solo [code][/code].
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #17 (permalink)  
Antiguo 19/11/2009, 20:40
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Ayuda con Dos JavaScript

Aqui esta el del texto parpadeante(Bueno en realidad se llama Texto luminoso espectacular).-

Código:
<span id="theText" style="width:100%"> 
<h3 align="center"><font color="#3a6ca3"><font size="+5">CREATUPROPIAWEB</font>
 </font><font color="#666666">
 <!-- Mas scripts en creatupropiaweb.com -->
 <script>              //     ^-the text that will be displayed
<!--
//can be edited from here
var from = 5;                       //the animation start value
var to = 11;                        //the animation end value
var delay = 55;                     //the animation speed
var glowColor = "red";              //the first color
var glowColor2 = "orange";          //the second color
var glowColor3 = "yellow";          //the third color
var glowColor4 = "lime";            //4th color
var glowColor5 = "blue";            //5th color
var glowColor6 = "magenta";         //last color
//no more editing
var i = to;
var j = 0;
textPulseDown();
function textPulseUp()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
}
function textPulseDown()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
}
//Copyright (c) 2001 Coyotee Labs Romania (coyoteelabs.go.ro)
//This script can be used freely as long as all copyright messages are
//intact. Visit COYOTEELABS.GO.RO for more scripts
function textPulseUp2()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp2()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
}
function textPulseDown2()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown2()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
}
function textPulseUp3()
{
if (!document.all)
return
if (i < to)
{
theText.style.filter = "Glow(Color=" + glowColor5 + ", Strength=" + i + ")";
i++;
theTimeout = setTimeout('textPulseUp3()',delay);
return 0;
}
if (i = to)
{
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
}
function textPulseDown3()
{
if (!document.all)
return
if (i > from)
{
theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
i--;
theTimeout = setTimeout('textPulseDown3()',delay);
return 0;
}
if (i = from)
{
theTimeout = setTimeout('textPulseUp()',delay);
return 0;
}
}
//-->
</script></font></h3></span>
Y por si lo necesitas el del reloj en el mouse.-

Código:
<SCRIPT language=JavaScript>
dCol="#FF0000";//date colour.
fCol="#0000FF";//face colour.
sCol="#FF0000";//seconds colour.
mCol="#FF0000";//minutes colour.
hCol="#FF0000";//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;

//Alter nothing below! Alignments will be lost!

d=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","DOMINGO");
m=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
 var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
 F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
 F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
 }
for (i=0; i < H.length; i++){
 var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
 HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
 HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
 }
for (i=0; i < M.length; i++){
 var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
 ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
 ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
 }
for (i=0; i < S.length; i++){
 var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
 SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
 SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
 }
for (i=0; i < D.length; i++){
 var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
 DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
 DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
 }
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
</SCRIPT>
Tardaras mucho en darme una respuesta ???
  #18 (permalink)  
Antiguo 19/11/2009, 21:52
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

ya encontre el problema, conflicto de variables. debido a la falta de organizacion en el codigo, ambos usan variables globales, y el problema se presenta cuando ambos usan el mismo identificador para nombrar las variables. esto comunmente sucede con los bucles. en este caso, ambos codigos usan la variable i para iterar los bucles. para corregirlo, tienes que decidirte por cual de los dos codigo reparar. una vez decidas solo uno, asignale un nombre diferente a todas las variables i. recalco, solo tienes que modificar uno de los dos, si modificas los dos volveras a tener el mismo conflicto. el punto es que ninguno de los dos codigos pueden usar las mismas variables.

paciencia y diviertase!
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #19 (permalink)  
Antiguo 19/11/2009, 21:54
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Ayuda con Dos JavaScript

Entonces....
Se pueden visualizar los dos correctamente...???

si es asi dime como
  #20 (permalink)  
Antiguo 19/11/2009, 22:01
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

se pueden visualizar los dos, pero como ya te indique, hay que cambiarle el nombre a unas variables. en este caso, la unica variable que tienes que cambiar es la variable i. tienes que localizarlas todas y darle otro nombre. por ejemplo,
Código:
// ejemplo de codigo original
for (i=0; i < n; i++)

// ejemplo con otro nombre
for (indice=0; indice < n; indice++)
en todas las ocurrencia de las variables i (en un solo script), lo cambias por indice. significa que tienes que leerlo con calma para localizar las variables. no puedes ir cambiando al azar porque si no es una variable estarias modificando otra cosa. adicional, no puedes darle un nombre ya ocupado, como la usada en este ejemplo, indice.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.

Última edición por zerokilled; 19/11/2009 a las 22:08
  #21 (permalink)  
Antiguo 19/11/2009, 22:09
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: Ayuda con Dos JavaScript

Mira, lo puse asi...

Código:
<SCRIPT language=JavaScript>
dCol="#FF0000";//date colour.
fCol="#0000FF";//face colour.
sCol="#FF0000";//seconds colour.
mCol="#FF0000";//minutes colour.
hCol="#FF0000";//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;

//Alter nothing below! Alignments will be lost!

d=new Array("DOMINGO","LUNES","MARTES","MIERCOLES","JUEVES","VIERNES","DOMINGO");
m=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (indice=0; indice < n; indice++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
 var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
 F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
 F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
 }
for (i=0; i < H.length; i++){
 var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
 HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
 HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
 }
for (i=0; i < M.length; i++){
 var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
 ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
 ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
 }
for (i=0; i < S.length; i++){
 var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
 SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
 SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
 }
for (i=0; i < D.length; i++){
 var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
 DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
 DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
 }
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
</SCRIPT>
Aclarame algo, esta bien asi?, es que ya lo puse y ya parpadea el texto pero el reloj no se mueve con el cursor, todos los numeros, letras se quedan amontonados en la esquina

Que hago???
  #22 (permalink)  
Antiguo 19/11/2009, 22:19
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

quisiera saber donde has hecho los cambios porque no los veo. mira por ejemplo todas las variables i que hay en esta pequeña porcion de codigo. todas ellas tienes que cambiarla por otro nombre, no solo en esta porcion sino en todo el codigo, pero de un solo script, del texto que parpadeo o del reloj.
Código:
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #23 (permalink)  
Antiguo 19/11/2009, 22:22
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

Osea que todas lasi las voy a cambiar por indice???
En todo el codigo de un solo script, por ejemplo en el del texto parpadeante todo va a ser asi ??
  #24 (permalink)  
Antiguo 19/11/2009, 22:25
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

es correcto!
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #25 (permalink)  
Antiguo 19/11/2009, 23:13
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript


Gracias, por fin funco!!
Pero ahora no funca con este codigo:

Código:
----- Abre <HEAD> y pega esto -----
		  
<style>
body{
overflow-x:hidden;
overflow-y:scroll;
}
</style>



----- Pega esto donde va a estar -----
<script language="JavaScript1.2">

/*
Scrollable Menu Links- By Dynamicdrive.com
For full source, TOS, and 100s DTHML scripts
Visit dynamicdrive.com

Modificado por creatupropiaweb.com
*/

//configura aqui las imágenes
var goleftimage='izquierda.gif'
var gorightimage='derecha.gif'
//configura la anchura del menú
var menuwidth=300
//configura la velocidad del scroll (1-10), cuanto mayor, mas rápido
var scrollspeed=6
//specify menu content
var menucontents='<nobr><a href="creatupropiaweb.com"><b>Creatupropiaweb</a> | <a href="google.com">Super buscador</a> | <a href="superpotencia.tk">El mundo de las 4 ruedas</a> | <a href="creatupropiaweb.com">Aumenta las visitas a tu web</b></a></nobr>'


////NO CAMBIES NADA A PARTIR DE AQUI////////////

var actualwidth=''
var ns_scroll
function fillup(){
if (document.all){
test2.innerHTML=menucontents
actualwidth=test2.offsetWidth
}
else if (document.layers){
ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
ns_scroll.document.write(menucontents)
ns_scroll.document.close()
actualwidth=ns_scroll.document.width
}
}
window.onload=fillup

function moveleft(){
if (document.all&&test2.style.pixelLeft>(menuwidth-actualwidth))
test2.style.pixelLeft-=scrollspeed
else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
ns_scroll.left-=scrollspeed
lefttime=setTimeout("moveleft()",50)
}

function moveright(){
if (document.all&&test2.style.pixelLeft<0)
test2.style.pixelLeft+=scrollspeed
else if (document.layers&&ns_scroll.left<0)
ns_scroll.left+=scrollspeed
righttime=setTimeout("moveright()",50)
}

if (document.all||document.layers){
with (document){
write('<table border="0" cellspacing="0" cellpadding="0">')
write('<td valign="middle"><a href=#" onMouseover="moveleft()" onMouseout="clearTimeout(lefttime)"><img src="'+goleftimage+'"border=0></a> </td>')
write('<td valign="top">')
if (document.all){
write('<span style="position:relative;width:'+menuwidth+';">')
write('<span style="position:absolute;width:'+menuwidth+';clip:rect(0 '+menuwidth+' auto 0)">')
write('<span id="test2" style="position:absolute;left:0;top:0">')
write('</span></span></span>')
}
else if (document.layers){
write('<ilayer width='+menuwidth+' name="ns_scrollmenu">')
write('<layer name="ns_scrollmenu2" left=0 top=0></layer></ilayer>')
}
write('</td>')
write('<td valign="middle"> <a href="#" onMouseover="moveright()" onMouseout="clearTimeout(righttime)">')
write('<img src="'+gorightimage+'"border=0></a>')
write('</td></table>')
}
}
</script>
Que debo de hacer para que tambien funcione???


=======================================
EDITADO
=======================================

Este codigo es para poner un menu de desplazamiento horizontal
con flechas...

Última edición por francisco_1993; 19/11/2009 a las 23:19 Razón: Definicion del Codigo
  #26 (permalink)  
Antiguo 19/11/2009, 23:32
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

el codigo funciona bien, de nuevo, solo en iexplorer.
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #27 (permalink)  
Antiguo 20/11/2009, 15:32
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Pregunta Respuesta: Ayuda con Dos JavaScript

Pero lo que quiero es que me ayudes, es que cuando lo pongo junto con el codigo del reloj en el cursor, los hipervinculos de este menuNO SE VEN

Necesito de tu ayuda nuevamente ZeroKilled, Please !!



El codigo del reloj es el mismo...
  #28 (permalink)  
Antiguo 20/11/2009, 18:37
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Ayuda con Dos JavaScript

ya tu tema no son dos script, sino tres script. y mañana no dudo que aprovecharas dos más y lo queras consultar aqui para agregarlo al mismo documento. ¿acaso queras copiarte todos los script digamos de dynamicdrive por ejemplo? mis disculpas pero ya me parece suficiente de tu parte. un consejo, no te acostumbres a solo copiar y pegar. lease un manual para que puedas depurar tus codigos porque estoy seguro que ni siquiera has intentado solucionarlo por ti. que otro se anime ayudarte pero hasta aqui te puedo ayudar con este tema. suerte...
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #29 (permalink)  
Antiguo 20/11/2009, 18:48
Avatar de francisco_1993  
Fecha de Ingreso: noviembre-2009
Mensajes: 46
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: Ayuda con Dos JavaScript

Bueno te agradezco por tu ayuda, aver si alguien quiere seguir ayudandome ya que tu no quieres....jeje

Bueno....
Adios y mil gracias

-------------------------------------------------------------------------------------------------------------------------------------
Editado
-------------------------------------------------------------------------------------------------------------------------------------

Acerca de la repuesta de ZeroKilled, me dices que porque no he tratado de solucionarlo por mi mismo; es que la verdad no se nada de programacion en JavaScript y por eso acudo a este foro para que me ayuden, pero bueno a nadie puedo obligar. si quieres volver a ayudarme ZeroKilled aqui estare y si no es asi, pues tendre que esperar a que alguien mas me ayude(Espero y haya mas personas ya que cuando inicie esto nadie me ayudo mas que tu ZeroKilled; bueno espero y lo consideres

Y otra vez, Mil Gracias por tu ayuda

Última edición por francisco_1993; 20/11/2009 a las 19:56 Razón: Complemento de la respuesta
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:46.