473,757 Members | 6,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modify script

Below is a script i need to modify to work and its driving me nuts.
Essentially it fades the content of an array. The original script
specified the object name, I tried to modify it to allow an object to
be passed instead as there are two fading areas on the page code
below, to be honest I could see absolutely no reason why but im not
that offay with javascript so this could be down to me.

Deadlines are getting tight on this one so not bothered how its done
but i need to be able to have fading content on the two specified
areas, one statscroller the other newscroller. The second content
array has been setup, news_fcontent, but it not used.

Any help is greatly appreciated.

<script type="text/javascript">
/*************** *************** *************** **
* Fading Scroller- © Dynamic Drive DHTML code library
(www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source
code
*************** *************** *************** ***/
var statsdelay = 3000; //set statsdelay between message change
(in miliseconds)
var statsmaxsteps=3 0; // number of steps to take to change from start
color to endcolor
var stepstatsdelay= 50; // time in miliseconds of a single step

//**Note: statsmaxsteps*s tepstatsdelay will be total time in
miliseconds of fading effect
var startcolor= new Array(148,189,2 35); // start color (red, green,
blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var stats_fcontent= new Array();

stats_fcontent[0]='<div class="fading_b anner1"><span class="title">'
+ <%= _totalValue %+ '</span><br/><span class="body">of jewellery
valued so far!</span></div>';
stats_fcontent[1]='<div class="fading_b anner1"><span class="title">'
+ <%= _totalCustomers %+ '</span><br/><span class="body">cu stomers
now protected!</span></div>';
stats_fcontent[2]='<div class="fading_b anner2"><span
class="title">W orking in association with</span><br /><br /><img
src="../images/national_associ ation_gsmiths.j pg" alt="National
Association of Goldsmiths" /></div>';

var news_fcontent=n ew Array();

news_fcontent[0]='<div class="news_ite m"><div class="news_tex t">' + <
%= _header1 %+ '<br />' + <%= _body1 %+ '<br /><a href="' + <%=
_href1 %+ '">More....</a></div><span class="image">< img src="' + <%=
_imgSrc1 %+ '" /></span></div>';
news_fcontent[1]='<div class="news_ite m"><div class="news_tex t">' + <
%= _header2 %+ '<br />' + <%= _body2 %+ '<br /><a href="' + <%=
_href2 %+ '">More....</a></div><span class="image">< img src="' + <%=
_imgSrc2 %+ '" /></span></div>';
news_fcontent[2]='<div class="news_ite m"><div class="news_tex t">' + <
%= _header3 %+ '<br />' + <%= _body3 %+ '<br /><a href="' + <%=
_href3 %+ '">More....</a></div><span class="image">< img src="' + <%=
_imgSrc3 %+ '" /></span></div>';

var _fade_links=1; //should links inside scroller content also fade
like text? 0 for no, 1 for yes.

var _ie4=document.a ll&&!document.g etElementById;
var _DOM2=document. getElementById;
var faderstatsdelay =0;
var _index=0;

stats_changecon tent;

/*Rafael Raposo edited function*/
//function to change content
function stats_changecon tent(){
if (_index>=stats_ fcontent.length )
_index=0
if (_DOM2){

document.getEle mentById("stats croller").style .color="rgb("+s tartcolor[0]+",
"+startcolo r[1]+", "+startcolo r[2]+")";

document.getEle mentById("stats croller").inner HTML=stats_fcon tent[_index];
if (_fade_links)
stats_linkcolor change(1);
stats_colorfade (1, 15);
}
else if (_ie4)
document.all.st atscroller.inne rHTML=stats_fco ntent[_index]
_index++
}

// stats_colorfade () partially by Marcio Galli for Netscape
Communications. ////////////
// Modified by Dynamicdrive.co m

function stats_linkcolor change(step){
var
obj=document.ge tElementById("s tatscroller").g etElementsByTag Name("A");
if (obj.length>0){
for (i=0;i<obj.leng th;i++)
obj[i].style.color=st ats_getstepcolo r(step);
}
}

/*Rafael Raposo edited function*/
var _fadecounter;
function stats_colorfade (step) {
if(step<=statsm axsteps) {

document.getEle mentById("stats croller").style .color=stats_ge tstepcolor(step );
if (_fade_links)
stats_linkcolor change(step);
step++;
_fadecounter=se tTimeout("stats _colorfade("+st ep+")",stepstat sdelay);
}else{
clearTimeout(_f adecounter);

document.getEle mentById("stats croller").style .color="rgb("+e ndcolor[0]+",
"+endcolor[1]+", "+endcolor[2]+")";
setTimeout("sta ts_changeconten t()", statsdelay);

}
}

/*Rafael Raposo's new function*/
function stats_getstepco lor(step) {
var diff
var newcolor=new Array(3);
for(var i=0;i<3;i++) {
diff = (startcolor[i]-endcolor[i]);
if(diff 0) {
newcolor[i] = startcolor[i]-(Math.round((di ff/
statsmaxsteps)) *step);
} else {
newcolor[i] = startcolor[i]+(Math.round((M ath.abs(diff)/
statsmaxsteps)) *step);
}
}
return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " +
newcolor[2] + ")");
}

if (window.addEven tListener)
window.addEvent Listener("load" , stats_changecon tent, false)
else if (window.attachE vent)
window.attachEv ent("onload", stats_changecon tent)
else if (document.getEl ementById)
window.onload=s tats_changecont ent
</script>
<div class="header"> LATEST NEWS....</div>
<div id="newscroller " class="news_ite m"/>
<a href="../valuationdays/valuationbookin g.aspx"><img src="../images/
book_a_valuatio n.jpg" alt="Book a valuation" border="0"/></a><br /
><br />
<a href="../valuationdays/searchvaluation days.aspx"><img src="../
images/locations.gif" alt="Find a valuation" border="0"/></a><br /
><br />
<div id="statscrolle r" />
Jun 27 '08 #1
5 1483
kidders wrote:
Below is a script i need to modify to work and its driving me nuts.
Why, isn't that what Dynamic *Drive* is for?
[...]
Any help is greatly appreciated.
Ask the people who are responsible for this junk instead. You're welcome.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 27 '08 #2
On 17 Apr, 14:03, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
kidders wrote:
Below is a script i need to modify to work and its driving me nuts.

Why, isn't that what Dynamic *Drive* is for?
[...]
Any help is greatly appreciated.

Ask the people who are responsible for this junk instead. You're welcome.

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
What an incredibly helpful reply...
Jun 27 '08 #3
kidders wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>kidders wrote:
>>Below is a script i need to modify to work and its driving me nuts.
Why, isn't that what Dynamic *Drive* is for?
>>[...]
Any help is greatly appreciated.
Ask the people who are responsible for this junk instead. You're welcome.
[...]

What an incredibly helpful reply...
Do you expect me to lie about the quality of the source (double sense) so
that you are satisfied with what you have and continue to cause your users
and yourself all kinds of trouble?
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jun 27 '08 #4
On 17 Apr, 14:10, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
kidders wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
kidders wrote:
Below is a script i need to modify to work and its driving me nuts.
Why, isn't that what Dynamic *Drive* is for?
>[...]
Any help is greatly appreciated.
Ask the people who are responsible for this junk instead. You're welcome.
[...]
What an incredibly helpful reply...

Do you expect me to lie about the quality of the source (double sense) so
that you are satisfied with what you have and continue to cause your users
and yourself all kinds of trouble?

PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
No, but im not asking for observations on the source code, i can tell
that myself even though im not offay with javascript. But as this was
already in place and im having to adapt it due to tight deadlines,
plus the fact im not fully familiar with javascript, a solution (be it
the code modified or an alternative) would have been much more helpful
than your sarcy comment.
Jun 27 '08 #5
kidders wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>kidders wrote:
>>[...] Thomas 'PointedEars' Lahn [...] wrote:
kidders wrote:
Below is a script i need to modify to work and its driving me
nuts.
Why, isn't that what Dynamic *Drive* is for?
[...] Any help is greatly appreciated.
Ask the people who are responsible for this junk instead. You're
welcome. [...]
What an incredibly helpful reply...
Do you expect me to lie about the quality of the source (double sense)
so that you are satisfied with what you have and continue to cause your
users and yourself all kinds of trouble? [...]

No, but im not asking for observations on the source code,
Usenet is not there to provide what you asked for.
i can tell that myself even though im not offay with javascript.
I doubt that very much.
But as this was already in place and im having to adapt it due to tight
deadlines, plus the fact im not fully familiar with javascript, a
solution (be it the code modified or an alternative) would have been much
more helpful than your sarcy comment.
So you painted yourself into a corner and blame others for not helping you
out of it.

I have named the place where you are likely to receive help about this code.
Unless you are willing to pay someone for the service, the only alternative
is to learn JavaScript yourself (for example, by reading here; there's also
a FAQ at <http://jibbering.com/faq/>) and to stop full-quoting here.
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Jun 27 '08 #6

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

Similar topics

2
1717
by: Got2Go | last post by:
Hello, I am trying to come up with a function that will search the source of the page for a specific string. If that string is found, then have it modify specific tags inside of a table and display a link on the page. This link, when clicked will then restore the modified tags back to their original values.
4
8730
by: jp.delatorre | last post by:
how to create script that modify xml file sample xml file: <root> <parent name="a" id="1"> <child name="a.a" id="1.1" /> <child name="a.b" id="1.2" /> <child name="a.c" id="1.3" /> </parent>
16
2923
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the form order to do that ? My point is for the client to be able to re-read the modified data.
11
11941
by: tlyczko | last post by:
Hello Rob B posted this wonderful code in another thread, http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/c84d8538025980dd/6ead9d5e61be85f0#6ead9d5e61be85f0 I could not figure out how to reply to the thread per se using Google Groups and so please forgive me for cutting and pasting (I emailed him but he may not have time to check his email), and I am hoping someone might be able to tell me how I can change this...
2
15070
by: Benjamin Rutt | last post by:
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script and run it under some smaller inputs for test purposes, while the long-running script is still running? It seems safe to do so, but I want to be sure. I know, for example, that #!/bin/sh on my system is not safe in this regard. I suppose this...
3
1967
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current page in a browser? ----------------------------------------------------------------------- Using the DOM the non-standard but widely implemented innerHTML extension, the following would be sufficient to modify the content of any element that can have content: « <div id="anID">Some Content</div» with script of «...
31
3542
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current browser window? ----------------------------------------------------------------------- In a default security environment you are very limited in how much you can modify the current browser window. You can use ` window.resizeTo ` or ` window.moveTo ` to resize or move a window respectively, but that is it. Normally you can...
1
1280
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current page in a browser? ----------------------------------------------------------------------- Using the DOM the non-standard but widely implemented innerHTML extension, the following would be sufficient to modify the content of any element that can have content: ` <div id="anID">Some Content</div` with script of `...
0
9489
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...
1
9885
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
9737
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...
0
8737
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 project—planning, coding, testing, and deployment—without 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...
1
7286
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
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
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
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
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.