Results 1 to 6 of 6
Thread: Please I need help, urgent
- 07-18-2011, 05:43 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 3
- Rep Power
- 0
Please I need help, urgent
Hi all,
I've got a problem, a friend helped me code this:
now the images rotate perfect so i have no problem with that, now instead of calling up the images from archive I want to be able to call them up using a javascript. something like the one below:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>rotate</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
var pictureArchive= new Array(4);
pictureArchive[0]='1.jpg';
pictureArchive[1]='2.jpg';
pictureArchive[2]='3.jpg';
pictureArchive[3]='4.jpg';
window.onload=function() {
var o=document.createElement('img');
o.setAttribute('id', 'image');
o.setAttribute('src', pictureArchive[0]);
alert (pictureArchive[0].src);
o.setAttribute('alt', '');
document.body.appendChild(o);
rotate(pictureArchive.length);
}
function rotate(idx) {
if(idx>=pictureArchive.length) {
idx=0;
}
document.getElementById('image').src=pictureArchiv e[idx++];
//document.write("<img src='" + pictureArchive[idx++] +"'/>");
timerID=setTimeout('rotate('+idx+')', 4000);
}
</script>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
now i have 5 sets of code just like this one, however i do not know how to call them up.<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zid=29681&wd=-1&ht=-1&target=_top"></script>
could someone please assist me I've been tryin to figure this out for days now...
- 07-18-2011, 06:21 PM #2
Ask your friend where there is javascript forum,
this is a java forum.
- 07-18-2011, 06:24 PM #3
Member
- Join Date
- Jul 2011
- Posts
- 3
- Rep Power
- 0
ooops.....sry
- 07-18-2011, 06:51 PM #4
Artemis
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
Hello,
My English is not good, I think you want call code javascript and not have insert it's to html file.
The first you created file "*.js"(ex: rotate_img.js) and copy script of you to it's
Continue you insert the code following after <meta> tag:Java Code:var pictureArchive= ['1.png','2.png','3.png','4.png']; window.onload=function() { var o=document.createElement('img'); o.setAttribute('id', 'image'); o.setAttribute('src', pictureArchive[0]); o.setAttribute('alt', ''); document.body.appendChild(o); rotate(pictureArchive.length); } function rotate(idx) { if(idx>=pictureArchive.length) { idx=0; } document.getElementById('image').src=pictureArchive[idx++]; timerID=setTimeout('rotate('+idx+')', 40); }
Now you have run html file.Java Code:<script type="text/javascript" src="rotate_img.js"></script>
//--------------------------------------------
You can downlod expamle:JavaScript_Rotate_Image.rarLast edited by bnson; 07-18-2011 at 06:59 PM.
- 07-19-2011, 10:17 AM #5
Member
- Join Date
- Jul 2011
- Posts
- 3
- Rep Power
- 0
hi,
sorry I have been unclear of what I need help with,
is a javascript code that calls up a banner/image with a tracker from a 3rd party entity, now I wish to replace the images that I have in archive with the javascript code displayed above.<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zid=29681&wd=-1&ht=-1&target=_top"></script>
hope this is more clear on what i need help with
- 07-19-2011, 06:12 PM #6
Artemis
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
Hi, nd4rk
I think you want insert your JavaScript to javascript of "g.adspeed.net, and you want change banner "AS#404: NO AD FOUND IN ROTATION" to your image.
what you want?
if this is what you want then implementation is required you have permission edit or change content of script,
else can not implement of required.
The code provide form a 3rd parte entity(http://g.adspeed.net/), I'm think you can't edit its. The link "http://g.adspeed.net/ad.php?do=js&zid=29681&wd=-1&ht=-1&target=_top" provide a code javascript and compiled to file *.js, we only call its.Java Code:<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zid=29681&wd=-1&ht=-1&target=_top"></script>
//------------------------------------------
I'm propose a solution, you have used both file *.js
Though not satisfactory, but I'm think look & feel of the link a better.Java Code:<script type="text/javascript" src="rotate_img.js"></script> <script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zid=29681&wd=-1&ht=-1&target=_top"></script>
Have nice day,....
Similar Threads
-
[URGENT]SHA Encryption System...need urgent helps
By java_idiot in forum New To JavaReplies: 6Last Post: 05-02-2010, 10:04 AM -
Urgent need
By anurag_1226 in forum AWT / SwingReplies: 2Last Post: 04-01-2010, 07:20 AM -
Urgent Help!!
By Winniee in forum New To JavaReplies: 5Last Post: 02-17-2009, 03:32 AM -
Help. It's urgent
By monir6464 in forum AWT / SwingReplies: 2Last Post: 08-24-2008, 05:57 PM


LinkBack URL
About LinkBacks

Bookmarks