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

Home Posts Topics Members FAQ

need help: Noobie

mcc
When i put these two java scripts in the same html file only the fade script
works.

Why is that???

this part is in the <head>

<!-Rollover Script à

<SCRIPT TYPE="text/javascript">

<!--

function newImage(arg) {

if (document.image s) {

rslt = new Image();

rslt.src = arg;

return rslt;

}

}

function changeImages() {

if (document.image s && (preloadFlag == true)) {

for (var i=0; i<changeImages. arguments.lengt h; i+=2)
{

document[changeImages.ar guments[i]].src
= changeImages.ar guments[i+1];

}

}

}

var preloadFlag = false;

function preloadImages() {

if (document.image s) {

ebay_12_over = newImage("image s/ebay_12-over.gif");

ebay_15_over = newImage("image s/ebay_15-over.gif");

ebay_18_over = newImage("image s/ebay_18-over.gif");

ebay_21_over = newImage("image s/ebay_21-over.gif");

ebay_24_over = newImage("image s/ebay_24-over.gif");

preloadFlag = true;

}

}

// -->

</SCRIPT>

<!-Rollover Script End à

this part is in the <body>


ONMOUSEOVER="ch angeImages('eba y_15', 'images/ebay_15-over.gif'); return
true;"
ONMOUSEOUT="cha ngeImages('ebay _15', 'images/ebay_15.gif'); return true;">


this(fade images) is in the <body>

<!-- Fade Images -->

<script language="JavaS cript1.2">

var slideshow_width ='150px' //SET IMAGE WIDTH

var slideshow_heigh t='100px' //SET IMAGE HEIGHT

var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)

var fadeimages=new Array()

//SET IMAGE PATHS. Extend or contract array as needed

fadeimages[0]="coin.jpg"

fadeimages[1]="jewl.jpg"

fadeimages[2]="gfx.jpg"

fadeimages[3]="fiddle.jpg "

fadeimages[4]="gold.jpg"

fadeimages[5]="cam.jpg"

fadeimages[4]="bbcards.jp g"

////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:hid den"><div id="canvas0"
style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t
+';top:0;left:0 ;filter:alpha(o pacity=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(o pacity=10);-moz-opacity:10"></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/100

}

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

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++

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/100

}

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>

</TD>

<!-- Fade Images -->



thx,

--
joe
Jul 20 '05 #1
3 1280
Could you post your total file?

"mcc" <ea**@nospam.ne t> schreef in bericht
news:7HHJb.2735 $zf.2484@okepre ad05...
When i put these two java scripts in the same html file only the fade script works.

Why is that???

this part is in the <head>

<!-Rollover Script à

<SCRIPT TYPE="text/javascript">

<!--

function newImage(arg) {

if (document.image s) {

rslt = new Image();

rslt.src = arg;

return rslt;

}

}

function changeImages() {

if (document.image s && (preloadFlag == true)) {

for (var i=0; i<changeImages. arguments.lengt h; i+=2) {

document[changeImages.ar guments[i]].src = changeImages.ar guments[i+1];

}

}

}

var preloadFlag = false;

function preloadImages() {

if (document.image s) {

ebay_12_over = newImage("image s/ebay_12-over.gif");
ebay_15_over = newImage("image s/ebay_15-over.gif");
ebay_18_over = newImage("image s/ebay_18-over.gif");
ebay_21_over = newImage("image s/ebay_21-over.gif");
ebay_24_over = newImage("image s/ebay_24-over.gif");
preloadFlag = true;

}

}

// -->

</SCRIPT>

<!-Rollover Script End à

this part is in the <body>


ONMOUSEOVER="ch angeImages('eba y_15', 'images/ebay_15-over.gif'); return
true;"
ONMOUSEOUT="cha ngeImages('ebay _15', 'images/ebay_15.gif'); return true;">


this(fade images) is in the <body>

<!-- Fade Images -->

<script language="JavaS cript1.2">

var slideshow_width ='150px' //SET IMAGE WIDTH

var slideshow_heigh t='100px' //SET IMAGE HEIGHT

var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)

var fadeimages=new Array()

//SET IMAGE PATHS. Extend or contract array as needed

fadeimages[0]="coin.jpg"

fadeimages[1]="jewl.jpg"

fadeimages[2]="gfx.jpg"

fadeimages[3]="fiddle.jpg "

fadeimages[4]="gold.jpg"

fadeimages[5]="cam.jpg"

fadeimages[4]="bbcards.jp g"

////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:hid den"><div id="canvas0"
style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t +';top:0;left:0 ;filter:alpha(o pacity=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(o pacity=10);-moz-opacity:10"></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/100

}

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

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++

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/100

}

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>

</TD>

<!-- Fade Images -->



thx,

--
joe

Jul 20 '05 #2
On Sun, 4 Jan 2004 12:36:54 +0100, Ang Talunin
<pl************ @no-reply.com> wrote:
Could you post your total file?


Could you please,

1) Not top-post
2) Trim your quotes

To the OP: Instead of posting the file, can you point to an on-line,
hosted copy of you page that features the scripts.

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #3
mcc

Could you post your total file?

i reposted up top...i made a simple web page. Should be easy for scripters
to ts.
Jul 20 '05 #4

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

Similar topics

3
3270
by: neilphan | last post by:
Hi Guys, Please HELP! I'm new to PHP and would like to get your professional help! I"m writing simple and small login app using php session variable. I have 3 php scripts. The first is just a simple php form, login.php, that passes the variables to auth.php.
6
1950
by: Aristotelis E. Charalampakis | last post by:
Hi all, this is a newbie question :-) I was wondering if there was a way to use the switch statement in a manner that each case statement includes more that a simple value. i.e.: switch ( myFloat ) { case >0: // ??? how do i write this ???
12
1921
by: MatthewMlane | last post by:
Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
2
1426
by: russ | last post by:
I'm a very noobie to VB.NET, just went through the Microsoft Intro class. I'm trying to write a simple app that connects to a remote PC and makes a modification to hklm\software\microsoft\windows nt\currentversion\winlogon However, it always gets a "System.UnauthorizedAccessException" "Cannot write to the registry key" error.
15
4646
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
0
3967
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
0
1008
by: wayneman2864 | last post by:
first off i'd like to say i'm vary new at programming and i don't want this but it's my brother that dose its the only thing he asked for, for christmas so please don't make rude comments. what im trying to do is make a program that would calculate all possible combinations. of numbers from 1-54 basicly he wants all the possible lottery number combinations.i thought it would be easy at first so i said yes to it and i don't want to disapoint...
0
1016
by: cyclopsboi | last post by:
Guys I have a question and any help would be greatly appreciated. I am starting with a small software company doing some web development. they want web access to an application written in c++. how would i do this? I figure that there is now intrinsic asp property that would allow them to talk and that i would probably need a com object of some kind. What do you say guys help a noobie out. Cyclopsboi
0
960
by: 7Percent | last post by:
Hi, I am just starting using python I was wondering if someone can help me with URL extraction and store it as a variable. Like theres a "<a href="www.google.com"><img src="google.gif"></a> How could I extract the url of the image and store it as a variable, any help would be appreciated.
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10225
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
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4139
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.