473,799 Members | 3,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help me with this script.

Hi,

When I put the first javascript, it works fine. As soon as I put the
second one, the effect stops on both and you can't see any pictures.
This is the script I'm using. {How can I have this effect in 3 areas of
the page?}What area of the script need to be change?

Thank you for your help.
=============== =============== =============== =============== =============== =============== =========

<script language="JavaS cript1.2" type="text/javascript">

var slideshow_width ='140px'
var slideshow_heigh t='225px'
var pause=3000

var fadeimages=new Array()
fadeimages[0]="photo1.jpg "
fadeimages[1]="photo2.jpg "
fadeimages[2]="photo3.jpg "

////NO need to edit beyond here/////////////

var preloadedimages =new Array()
for (p=0;p<fadeimag es.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=fadeimages[p]
}

var ie4=document.al l
var dom=document.ge tElementById

if (ie4||dom)
document.write( '<div
style="position :relative;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t+';overflow:hi dden"><div

id="canvas0"
style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t+';top:0;left: 0;filter:alpha( opacity=10);-moz-opacity:10"></div><div

id="canvas1"
style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t+';top:0;left: 0;filter:alpha( opacity=10);-moz-opacity:10;visi bility:

hidden"></div></div>')
else
document.write( '<img name="defaultsl ide" src="'+fadeimag es[0]+'">')

var curpos=10
var degree=10
var curcanvas="canv as0"
var curimageindex=0
var nextimageindex= 1
function fadepic(){
if (curpos<100){
curpos+=10
if (tempobj.filter s)
tempobj.filters .alpha.opacity= curpos
else if (tempobj.style. MozOpacity)
tempobj.style.M ozOpacity=curpo s/101
}
else{
clearInterval(d ropslide)
nextcanvas=(cur canvas=="canvas 0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document. all."+nextcanva s) :
document.getEle mentById(nextca nvas)
tempobj.innerHT ML='<img src="'+fadeimag es[nextimageindex]+'">'
nextimageindex= (nextimageindex <fadeimages.len gth-1)? nextimageindex+ 1 :
0
var tempobj2=ie4? eval("document. all."+nextcanva s) :
document.getEle mentById(nextca nvas)
tempobj2.style. visibility="hid den"
setTimeout("rot ateimage()",pau se)
}
}

function rotateimage(){
if (ie4||dom){
resetit(curcanv as)
var crossobj=tempob j=ie4? eval("document. all."+curcanvas ) :
document.getEle mentById(curcan vas)
crossobj.style. zIndex++
tempobj.style.v isibility="visi ble"
var temp='setInterv al("fadepic()", 50)'
dropslide=eval( temp)
curcanvas=(curc anvas=="canvas0 ")? "canvas1" : "canvas0"
}
else
document.images .defaultslide.s rc=fadeimages[curimageindex]
curimageindex=( curimageindex<f adeimages.lengt h-1)? curimageindex+1 : 0
}

function resetit(what){
curpos=10
var crossobj=ie4? eval("document. all."+what) :
document.getEle mentById(what)
if (crossobj.filte rs)
crossobj.filter s.alpha.opacity =curpos
else if (crossobj.style .MozOpacity)
crossobj.style. MozOpacity=curp os/101
}

function startit(){
var crossobj=ie4? eval("document. all."+curcanvas ) :
document.getEle mentById(curcan vas)
crossobj.innerH TML='<img src="'+fadeimag es[curimageindex]+'">'
rotateimage()
}

if (ie4||dom)
window.onload=s tartit
else
setInterval("ro tateimage()",pa use)

</script>


Jul 23 '05 #1
3 1296
|:::. George .::::| wrote:
Hi,

When I put the first javascript, it works fine. As soon as I put the
second one, the effect stops on both and you can't see any pictures.
Yep. Thats what happens when someone copy/paste a script that they do
not understand.
This is the script I'm using.
Its junk.
How can I have this effect in 3 areas of the page?
Write a script to do it in 3 places.
What area of the script need to be change?
All of it.
Thank you for your help.


Welcome.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Randy, thank you for your answer but could you please pass some of your
knowledge and help me with this script?

Thanks

Randy Webb wrote:
|:::. George .::::| wrote:
Hi,

When I put the first javascript, it works fine. As soon as I put the
second one, the effect stops on both and you can't see any pictures.


Yep. Thats what happens when someone copy/paste a script that they do
not understand.
This is the script I'm using.


Its junk.
How can I have this effect in 3 areas of the page?


Write a script to do it in 3 places.
What area of the script need to be change?


All of it.
Thank you for your help.


Welcome.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq


Jul 23 '05 #3
|:::. George .::::| wrote:
Randy, thank you for your answer but could you please pass some of your
knowledge and help me with this script?

Thanks


The group FAQ is linked to in my signature. You should read it,
thoroughly along with the rest of my signature.

Then post what it is, in detail, that you want. I have no desire to wade
through that garbage code to try to decipher what it's supposed to be doing.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4643
by: John Dalberg | last post by:
Hi I have a form that opens a new window for the results. Because the results might take a few seconds due to server processing, I would like to display a message "please wait" in the new window, erase that message when the processing is done and show the results. How is this done? John Dalberg
11
1926
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73, object expected.
11
1604
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73, object expected.
0
2292
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web Setup Project and installed My Web Application on my Localhost and it works perfectly. When I install My Web Application on our “Production Server” it just doesn’t update the records on Edit mode!!!
7
7572
by: adamalton | last post by:
Hi, I'm building a site where the user enters some info into a form which submits to a php script. The php script takes a long time to execute (anywhere from 10 seconds to a minute) and when it finally finishes the page that it creates appears to get blocked by any firewall (tried on lots of different browsers/platforms) and you just get a completely blank page. (It's fine when just running on my local machine.) I'm guessing that the script...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.