Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > JavaScript
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

JavaScript JavaScript are you needing help with functions in your script, free help is offered here for all JavaScript problems so if you have an JavaScript error in your code just ask.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 4:38 PM   #1
P Wolpert
 
P Wolpert's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Need help with script conflict (Two scripts on one page)

This is my first post. I hope I don't sound stupid.
I have a script conflict when I put two scripts on one page. Both scripts
will work if I use one at a time but the menu button script will not work
when I add the scrolling text script. One script, the menu button script,
has an "Onload" command and the other one does not. From what I know, and
that's not much, I need to put both scripts in the "Onload" command. I just
don't know how to write the script for the scrolling text because it doesn't
use the "Onload" command. Here is the script I'm using. If anyone has a fix,
I thank you much.

Pat

IN THE HEAD.......

<title>Recipe 10.8</title>

<style id="main" type="text/css">

body {background-color:#eeeeee; font-family:Arial,Helvetica,sans-serif;
font-size:12px;}

h1 {font-size:2.0em; font-weight:bold}

</style>

<link rel="stylesheet" href="menus.css" type="text/css" />

<script language="JavaScript" type="text/javascript"
src="menus.js"></script>



IN THE BODY FOR THE MENU BUTTONS..........



<body onload="initMenus()">



<div id="menubar" align="left"><left>

<table border="0" width="100">

<tr>

<td>

<a href="index.html"><img id="menuImg_1" class="menuImg"

src="_images/home.gif" border="0" height="20"

width="125"></td>

</tr>

<tr>

<td><a href="heritage.html"><img id="menuImg_2"

class="menuImg" src="_images/heritage.gif" border="0" height="20"

width="125"></td></tr>

<tr>

<td><a href="ministries.html"><img id="menuImg_3"

class="menuImg" src="_images/ministries.gif" border="0"

height="20" width="125"></td></tr>

<tr>

<td><a href="missionaries.html"><img id="menuImg_4"

class="menuImg" src="_images/missionaries.gif" border="0"

height="20" width="125"></td></tr>

<tr>

<td><a href="calendar.html"><img id="menuImg_5"

class="menuImg" src="_images/calendar.gif" border="0"

height="20" width="125"></td></tr>

<tr>

<td><a href="feedback.html"><img id="menuImg_6"

class="menuImg" src="_images/feedback.gif" border="0"

height="20" width="125"></td></tr>

<tr>

<td><a href="contact.html"><img id="menuImg_7"

class="menuImg" src="_images/contact.gif" border="0"

height="20" width="125"></td></tr>

<tr>

<td><a href="Directory/directory.html"><img id="menuImg_8"

class="menuImg" src="_images/directory.gif" border="0"

height="20" width="125"></td></tr>

</table

</left>

</div>



IN THE BODY FOR THE SCROLLING TEXT..............



<script type="text/javascript">



/***********************************************

* Pausing updown message scroller- © Dynamic Drive DHTML code library
(www.dynamicdrive.com)

* This notice MUST stay intact for legal use

* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

***********************************************/



//configure the below five variables to change the style of the scroller

var scrollerdelay='6000' //delay between msg scrolls. 3000=3 seconds.

var scrollerwidth='200px'

var scrollerheight='220px'

var scrollerbgcolor=''

//set below to '' if you don't wish to use a background image

var scrollerbackground="yes"





//configure the below variable to change the contents of the scroller

var messages=new Array()

messages[0]="<font face='Arial'><BR><BR><B>Welcome to Faith Calvary
Church</B></font>"

messages[1]="<font face='Arial'><B>Information in this area will be updated
often.</B></font>"

messages[2]="<font face='Arial'><B><BR>Come back often for more
information</B></font>"





///////Do not edit pass this line///////////////////////



var ie=document.all

var dom=document.getElementById



if (messages.length>2)

i=2

else

i=0



function move1(whichlayer){

tlayer=eval(whichlayer)

if (tlayer.top>0&&tlayer.top<=5){

tlayer.top=0

setTimeout("move1(tlayer)",scrollerdelay)

setTimeout("move2(document.main.document.second)", scrollerdelay)

return

}

if (tlayer.top>=tlayer.document.height*-1){

tlayer.top-=5

setTimeout("move1(tlayer)",50)

}

else{

tlayer.top=parseInt(scrollerheight)

tlayer.document.write(messages[i])

tlayer.document.close()

if (i==messages.length-1)

i=0

else

i++

}

}



function move2(whichlayer){

tlayer2=eval(whichlayer)

if (tlayer2.top>0&&tlayer2.top<=5){

tlayer2.top=0

setTimeout("move2(tlayer2)",scrollerdelay)

setTimeout("move1(document.main.document.first)",s crollerdelay)

return

}

if (tlayer2.top>=tlayer2.document.height*-1){

tlayer2.top-=5

setTimeout("move2(tlayer2)",50)

}

else{

tlayer2.top=parseInt(scrollerheight)

tlayer2.document.write(messages[i])

tlayer2.document.close()

if (i==messages.length-1)

i=0

else

i++

}

}



function move3(whichdiv){

tdiv=eval(whichdiv)

if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.t op)<=5){

tdiv.style.top=0+"px"

setTimeout("move3(tdiv)",scrollerdelay)

setTimeout("move4(second2_obj)",scrollerdelay)

return

}

if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){

tdiv.style.top=parseInt(tdiv.style.top)-5+"px"

setTimeout("move3(tdiv)",50)

}

else{

tdiv.style.top=parseInt(scrollerheight)

tdiv.innerHTML=messages[i]

if (i==messages.length-1)

i=0

else

i++

}

}



function move4(whichdiv){

tdiv2=eval(whichdiv)

if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style .top)<=5){

tdiv2.style.top=0+"px"

setTimeout("move4(tdiv2)",scrollerdelay)

setTimeout("move3(first2_obj)",scrollerdelay)

return

}

if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){

tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"

setTimeout("move4(second2_obj)",50)

}

else{

tdiv2.style.top=parseInt(scrollerheight)

tdiv2.innerHTML=messages[i]

if (i==messages.length-1)

i=0

else

i++

}

}



function startscroll(){

if (ie||dom){

first2_obj=ie? first2 : document.getElementById("first2")

second2_obj=ie? second2 : document.getElementById("second2")

move3(first2_obj)

second2_obj.style.top=scrollerheight

second2_obj.style.visibility='visible'

}

else if (document.layers){

document.main.visibility='show'

move1(document.main.document.first)

document.main.document.second.top=parseInt(scrolle rheight)+5

document.main.document.second.visibility='show'

}

}



window.onload=startscroll



</script>





<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight};
bgColor=&{scrollerbgcolor}; background=&{scrollerbackground};
visibility=hide>

<layer id="first" left=0 top=1 width=&{scrollerwidth};>

<script language="JavaScript1.2">

if (document.layers)

document.write(messages[0])

</script>

</layer>

<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>

<script language="JavaScript1.2">

if (document.layers)

document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])

</script>

</layer>

</ilayer>



<script language="JavaScript1.2">

if (ie||dom){

document.writeln('<div id="main2"
style="position:relative;width:'+scrollerwidth+';h eight:'+scrollerheight+';overflow:hidden;backgroun d-color:'+scrollerbgcolor+'
;background-image:url('+scrollerbackground+')">')

document.writeln('<div
style="position:absolute;width:'+scrollerwidth+';h eight:'+scrollerheight+';clip:rect(0
'+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')

document.writeln('<div id="first2"
style="position:absolute;width:'+scrollerwidth+';l eft:0px;top:1px;">')

document.write(messages[0])

document.writeln('</div>')

document.writeln('<div id="second2"
style="position:absolute;width:'+scrollerwidth+';l eft:0px;top:0px;visibility:hidden">')

document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])

document.writeln('</div>')

document.writeln('</div>')

document.writeln('</div>')

}

</script>





 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
REQ: Anyone know where I can find a "Today In History" php script for my web page? Dan PHP 0 07-01-2007 4:26 PM
A PHP script requires me to compile some scripts how do I dothis???? Marius Mathiesen PHP 0 07-01-2007 2:59 PM
ScriptRunner script for CS2, neat way to launch scripts Timo Autiokari Graphics in general 2 06-11-2007 11:26 PM
conflict v6 with v5?? Dean Bartlett Graphics in general 2 06-11-2007 10:12 PM
Conflict between AGP on the Intel motherboard and ATI Radeon 8500 DV Card pjayant Motherboards 1 06-11-2007 12:07 PM


Featured Websites




All times are GMT +1. The time now is 2:05 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98