Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

HELP!!! I can't put in 2 HTML codes at one time

Posted 05 Oct 2005 01:19:56
1
has voted
05 Oct 2005 01:19:56 m saqib posted:
Hiya,

as it says in the subject: i can't put two HTML codes into my website at one time. I can INSERT them, but only one will work. if i try to make the other one work, the other one won't work! I need help on this badly and i really don't know what to do!

Thanks!<b></b><font size=4></font id=size4>

Replies

Replied 06 Oct 2005 22:45:43
06 Oct 2005 22:45:43 Simon Martin replied:
Can you explain what you are trying to do please?
I don't understand - maybe you could post your code here so we can have a look for you

Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 06 Oct 2005 23:28:11
06 Oct 2005 23:28:11 m saqib replied:
Well, i want to put in the following codes, first one for a marquee ticker, and the second one for live date and time. Only the marquee ticker works. And when i make the live date and time work, the marquee ticker doesn't work.

This is the marquee ticker one:

&lt;script language="JavaScript1.2"&gt;/*
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="550px"
//Specify the marquee's height
var marqueeheight="20px"

//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//configure background color:
var marqueebgcolor="#99EEFF"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content (don't delete &lt;nobr&gt; tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='&lt;nobr&gt;&lt;font face="Arial"&gt;Brand new kit released! Read below!&lt;/a&gt;.......Eagles manager still looking for new faces &lt;a href="www.msn.com"&gt; click here! &lt;/a&gt; &lt;/font&gt;&lt;/nobr&gt;'


////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('&lt;span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px"&gt;'+marqueecontent+'&lt;/span&gt;')
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee" : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp".offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)&gt;(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left&gt;(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('&lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;td&gt;')
if (iedom){
write('&lt;div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden"&gt;')
write('&lt;div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"&gt;')
write('&lt;div id="iemarquee" style="position:absolute;left:0px;top:0px"&gt;&lt;/div&gt;')
write('&lt;/div&gt;&lt;/div&gt;')
}
else if (document.layers){
write('&lt;ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'&gt;')
write('&lt;layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"&gt;&lt;/layer&gt;')
write('&lt;/ilayer&gt;')
}
document.write('&lt;/td&gt;&lt;/table&gt;')
}
}

function move(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)&gt;0&&parseInt(tdiv.style.top)&lt;=5){
tdiv.style.top=0+"px"
setTimeout("move(tdiv)",scrollerdelay)
setTimeout("move2(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)&gt;=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)+"px"
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)&gt;0&&parseInt(tdiv2.style.top)&lt;=5){
tdiv2.style.top=0+"px"
setTimeout("move2(tdiv2)",scrollerdelay)
setTimeout("move(first2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv2.style.top)&gt;=tdiv2.offsetHeight*-1){
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
setTimeout("move2(second2_obj)",50)
}
else{
tdiv2.style.top=parseInt(scrollerheight)+"px"
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function startscroll(){
first2_obj=ie? first2 : document.getElementById("first2"
second2_obj=ie? second2 : document.getElementById("second2"
move(first2_obj)
second2_obj.style.top=scrollerheight
second2_obj.style.visibility='visible'

}

if (ie||dom){
document.writeln('&lt;div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+'')
document.writeln('&lt;div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px"&gt;')
document.writeln('&lt;div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;"&gt;')
document.write(messages[0])
document.writeln('&lt;/div&gt;')
document.writeln('&lt;div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden"&gt;')
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
document.writeln('&lt;/div&gt;')
document.writeln('&lt;/div&gt;')
document.writeln('&lt;/div&gt;')
}

if (window.addEventListener)
window.addEventListener("load", startscroll, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroll)
else if (ie||dom)
window.onload=startscroll




&lt;/script&gt;



And this is the live date and time one:

&lt;html&gt;

&lt;body onLoad="goforit()"&gt;

&lt;script&gt;

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit www.dynamicdrive.com
*/


var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December"

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year &lt; 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym&lt;10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours&gt;=12)
dn="PM"
if (hours&gt;12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes&lt;=9)
minutes="0"+minutes
if (seconds&lt;=9)
seconds="0"+seconds
//change font size here
var cdate="&lt;small&gt;&lt;font color='000000' face='Arial'&gt;&lt;b&gt;"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"&lt;/b&gt;&lt;/font&gt;&lt;/small&gt;"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock".innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

&lt;/script&gt;
&lt;span id="clock"&gt;&lt;/span&gt;

&lt;/body&gt;
&lt;/html&gt;


I know that both codes work as i have tried them out individually. But i need them to work together and at the same time.

Thanks!

Reply to this topic