PDA

View Full Version : I have a menu script and a scroller script on the



paynecountyline
05-19-2005, 10:45 PM
I have a scroller script and a menu script, Java, on the front page of a site I am building. The scroller was working fine, and I added the menu script to the <head> and it did not show up. I took off the scroller <head> script and left the rest in body and the menu works, so I guess I have a conflict. I know nothing about java. this is the menu head script... <script type="text/javascript" src="includes/browser.js">
/***********************************************
* Jim's DHTML Menu v5.7- Jim Salyer ([email protected])
* Visit Dynamic Drive: http://www.dynamicdrive.com for script and instructions
* This notice must stay intact for use
***********************************************/
</script>
<script type="text/javascript" src="config.js"></script>

and this is the script for the scroller...
<script type="text/javascript" language="JavaScript1.2" src="ajlib.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="ajscroller.js"></script>

What do I do to this that will allow this to work together, or can I do this?

thanks.. pcl

Harry Armadillo
05-19-2005, 11:33 PM
Without the actual scripts, or at least a link to them, there's no way for anyone to help you.

_Aerospace_Eng_
05-19-2005, 11:36 PM
The likely problem is you have to window.onloads conflicting with each other, they would need to be in the body tag

<body onload="blah();blah2();">
One more thing, that irritates me a bit, Java is NOT Javascript. They are two totally different languages, please don't confuse them.

paynecountyline
05-19-2005, 11:46 PM
I am sorry for not posting the whole deal. but the page does not work with both on there.. I will post the page later this evening for some helpful hints.. and

I am very sorry for mixing up the two.. I am new, but you can bet on one thing, I won't make the mistake of calling java and javascript the same.. again.. thanks for the helpful responses. I will fix up a page and get it online.. and leave the address here in a bit.. thanks again..

paynecountyline
05-19-2005, 11:56 PM
here is the menu head script:

<script type="text/javascript" src="includes/browser.js">
/***********************************************
* Jim's DHTML Menu v5.7- Jim Salyer ([email protected])
* Visit Dynamic Drive: http://www.dynamicdrive.com for script and instructions
* This notice must stay intact for use
***********************************************/
</script>
<script type="text/javascript" src="config.js"></script>

Here is the onload that goes in body with the above script.

~~~~~~~~~~~~~~~~`

here is the head script for scroller:

<script type="text/javascript" language="JavaScript1.2" src="ajlib.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="ajscroller.js"></script>

here is the script that is in the body, but I don't find an onload for it.. just the script in the body:
<script>ajscroller1 = new AJScroller();
ajscroller1.name = 'ajscroller1';
ajscroller1.type = 0;
ajscroller1.width = 250;
ajscroller1.height = 75;
ajscroller1.spacing = 0;
ajscroller1.scrollspeed = 50;
ajscroller1.pausedelay = 2000;
ajscroller1.pausemouseover = true;
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.add('Ernie and Peggy Pickens Farm Retirement Auction, May 14, 2005, 10am, Stillwater<br><br>Thanks for your good business!<br><br>Lester Mahaffey Estate Farm Auction, May 21, 2005, 10am, Glencoe<br><br>Did we mention we appreciate you!<br><br>Wagoner Fence & Construction Liquidation, June 18th, 2005, 10am, Guthrie<br><br>Thanks for your continued support!<br><br>', '', 'Item 1');

/* -- Replicate Items -- */
ajscroller1.display();
onload = function(){ajscroller1.load();ajscroller1.start();};
onresize = function(){ajscroller1.load();};

</script>

The end.

The site is www.pickensauctions.com. I will add into the head the scroller script.. and the menu does not work.. this way you can see the page.. thanks everyone for you kind help!

_Aerospace_Eng_
05-20-2005, 12:06 AM
here is the script that is in the body, but I don't find an onload for it.. just the script in the body



/* -- Replicate Items -- */
ajscroller1.display();
onload = function(){ajscroller1.load();ajscroller1.start();};
onresize = function(){ajscroller1.load();};
1. Comments in Javascript are started with // not /*
2. Add this into your head tags as well as your menu script.

function startscroll(){
ajscroller1.load();ajscroller1.start();}

3.Take out this the line in red here:

/* -- Replicate Items -- */
ajscroller1.display();
onload = function(){ajscroller1.load();ajscroller1.start();};
onresize = function(){ajscroller1.load();};
4. Add this to onload="init()" in your body tag

startscroll()
So your body tag should look like this

<BODY onLoad="init();startscroll();" bgColor=#ffffff background="../images/bkgd3.jpg">
That should do it, if not then I will test it further.

paynecountyline
05-20-2005, 12:45 AM
YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
It worked great the first time. Now I will study what you had me do and see if I can learn from it.

You are amazing! Thanks very much for your thoughtfulness and kindness in helping me out of a real jam. I have fought with this for over a month off and on, never quite figuring it out, but I have learned a great deal from this. Not bad for a 58 year old dirt farmer from Oklahoma here.. haha..

Thanks again, I really truly appreciate it very much! Stan

_Aerospace_Eng_
05-20-2005, 12:51 AM
Glad I could have helped. We all gotta start somewhere. I started 3 years ago, I am 19 now going on 20.

paynecountyline
05-20-2005, 01:02 AM
you are darn good! And very thoughtful to help out.. thanks again, I really appreciate it very much.. Good luck in your future endeavors, I know you will do very well~! We will be reading about you in the "Rolling Stone" someday.. on the cover too, I bet!

My best to you,

Thanks...
Stan