PDA

View Full Version : Can these two scripts be combined?



moodyone00
10-15-2008, 11:49 PM
1) Script Title: Up down slideshow Script
By Dynamic Drive (www.dynamicdrive.com) &
<script language="JavaScript" src="navcond.js"></script>



Won't let me paste it all at one time, so here's the first script, second to follow.

Here is how I pasted everything into the <head>

<head>


<script language="JavaScript1.2">

/*
Up down slideshow Script
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100's more scripts, visit http://www.dynamicdrive.com
*/

///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth='103px'
var scrollerheight='106px'
//3000 miliseconds=3 seconds
var pausebetweenimages=3000

//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<a href="http://www.cnn.com"><img src="PE01805A.gif" border="0"></a>'
slideimages[1]='<img src="PE01803A.gif">'
slideimages[2]='<img src="TN00411A.gif">'
slideimages[3]='<img src="PE02054A.gif">'
slideimages[4]='<img src="cake.gif">'
//extend this list

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

var ie=document.all
var dom=document.getElementById

if (slideimages.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)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.top=parseInt(scrollerheight)
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.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)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.top=parseInt(scrollerheight)
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2_obj)",pausebetweenimages)
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=scrollerheight
tdiv.innerHTML=slideimages[i]
if (i==slideimages.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)",pausebetweenimages)
setTimeout("move3(first2_obj)",pausebetweenimages)
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=scrollerheight
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.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(scrollerheight)+5
document.main.document.second.visibility='show'
}
}

window.onload=startscroll

</script>


<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; visibility=hide>
<layer id="first" left=0 top=1 width=&{scrollerwidth};>
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[0])
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
</script>
</layer>
</ilayer>

<script language="JavaScript1.2">
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
</script>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://dynamicdrive.com">Dynamic Drive</a></font></p>

moodyone00
10-15-2008, 11:50 PM
<valign="top">
<script language="JavaScript" src="navcond.js"></script>
<script language="JavaScript">

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(100, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Public File", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Mail Receipts", "http://www.county-line.net/mail.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("Print Receipts", "http://www.county-line.net/print.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("Website Hits", "http://www.county-line.net/hits.htm"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(175, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Affiliate Chambers", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Baird", "http://www.bairdtexas.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Breckenridge", "http://www.breckenridgetexas.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Cisco", "http://www.ciscotx.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Cross Plains", "http://www.crossplains.com/COC.htm"));
dhtmlMenu.addItem(new NavBarMenuItem("DeLeon", "http://www.deleontexas.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Eastland", "http://www.eastlandtexas.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Gorman", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Rising Star", "http://www.risingstartexas.com/"));

myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(150, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Advertiser Links", ""));
dhtmlMenu.addItem(new NavBarMenuItem("AlphaGraphics", "http://us607.alphagraphics.com/"));
dhtmlMenu.addItem(new NavBarMenuItem("Ann Williams Real Estate", "http://www.annwilliamsrealestate.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Antiques From Our Father's House", "http://www.ourfathersantiques.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Clark Tractor", "http://www.clarktractor.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Crossroad Realtors", "http://www.crossroadrealtors.com/"));
dhtmlMenu.addItem(new NavBarMenuItem("Eastland Memorial Hospital", "http://www.eastlandmemorial.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Elite Plumbling", "http://www.eliteplumbingllc.com/"));
dhtmlMenu.addItem(new NavBarMenuItem("First Financial Bank", "http://www.ffin.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(150, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Advertiser Links", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Fullen Motor Company", "http://www.fullenmotors.com"));
dhtmlMenu.addItem(new NavBarMenuItem("IntegraCare Home Health", "http://www.integracarehh.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Kenmor Properties", "http://www.kenmorproperties.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Rising Star Vineyards", "http://www.risingstarvineyards.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Stanley Eastland", "http://www.stanleyeastland.com"));
dhtmlMenu.addItem(new NavBarMenuItem("State Farm - Clint Coffee", "http://clintcoffee.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Texas Cattle Exchange", "http://www.texascattleexchange.com/"));
dhtmlMenu.addItem(new NavBarMenuItem("United Country Smart Real Estate", "http://www.unitedcountry.com/eastlandtx"));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Medical", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Mitchell County Hospital", "http://www.mitchellcountyhospital.com/"));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Churches", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Civic", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Forums", ""));
dhtmlMenu.addItem(new NavBarMenuItem("CCity Forum", "http://excoboard.com/exco/index.php?boardid=20056"));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Reserved", ""));
myNavBar1.addMenu(dhtmlMenu);

//set menu colors
myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#666666", "#000000", "#cccccc", "#ffffff", "#000080")

//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")

var fullWidth;

function init() {

// Get width of window, need to account for scrollbar width in Netscape.

fullWidth = getWindowWidth()
- (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);

myNavBar1.resize(fullWidth);
myNavBar1.create();
myNavBar1.setzIndex(2);
myNavBar1.moveTo(0, 110);
//UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels
//myNavBar1.moveTo(0, 100);
}
</script>

<title>County Line</title>
<meta name="description" content="Eastland County, Texas Newspaper.">
<meta name="keywords" content="eastland county texas, ranger texas,eastland texas, rising star texas, cisco texas, desdemona texas, gorman texas ">



</head>
<body>
<body STYLE="background-image: url(http://www.county-line.net/play/map.jpg)">

<body onload="init()">

</body>
</html>


Thx for any help and I know ziltch about this (as if you couldn't tell, sigh)

jscheuer1
10-16-2008, 09:04 AM
Won't let me paste it all at one time, so here's the first script, second to follow.

I know it is like your first time posting about code, at least here. But if these scripts are on Dynamic Drive, you should just post the link to their respective demo pages. This actually would make it much easier for me (and probably most others who could) to answer your question.

Even better is to make up a simple demo of the problem, put it online and post a link to it.

Doing both is the best way to help us help you.

When code must be posted, it should be for short scripts or excerpts of larger ones, just to show a specific issue or an example that can be replicated to achieve the desired result. And then, it should be ensconced in code tags. To do that, put:



script code goes here


around it, so that it appears like so:



script code goes here


when previewed or submitted.

Now, the guidelines for this forum state that questions about combining scripts may not be answered, but if you link to the scripts and put up a demo (as I was mentioning), I or someone else would be more likely to take a crack at it.

Generally scripts can be combined, it is just a matter of resolving any conflicts. In actual practice (depending upon the scripts), sometimes this is very complicated or makes no sense. Other times it can be a relatively simple matter and can work out well.