Jump to content


  • Posts

  • Joined

  • Last visited

About stockton

  • Birthday 05/13/1939

Profile Information

  • Location
    South Africa Midrand

stockton's Achievements


Newbie (1/7)



  1. Using alert() has helped resolve this issue. Thanks for your input.
  2. I have javascript as follows function newDoc() { window.location.href = ""; } If I call this function from my javascript as follows newDoc();[/code]it fails but if called from HTML[code]<input type="button" nanme="SelectButton" id="SelectButton" value="Login" onclick="newDoc()" height="50" /> it works.Please tell me what I am getting wrong.
  3. I have heard a rumour that it is possible to create apps for smart phones using only HTML5, CSS3 & JavaScript.Up till now I have used PhoneGap to make my programs cross platform compatible, but I have been given to understand that with only HTML5, CSS3 and Javascript one can create crossplatform applications(Cross platform = Android, IOS and Blackberry).Can someone please point me in the correct direction?
  4. I have followed the procedure at http://community.lin...torial/view/486 to install LAMP on my Mint 13 laptop with a view to developing locally & once working emigrate to my server but ...... the following simple HTML only displays the title(No image). The image does exist in the images folder & it makes no difference if I refer to it with ./images/prince.jpg or images/prince.jpg.Please tell me how I got the install wrong.<!DOCTYPE html><html><title>Jim Beam</title><meta name="author" content="Alf C Stockton"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta http-equiv="cache-control" content="no-cache" /><meta http-equiv="expires" content="Mon, 22 Jul 2000 11:12:01 GMT" /><meta name="viewport" content="width=device-width,initial-scale=1"><script language="Javascript" src="./js/prince.js"></script></head><body><center><img src="./images/prince.jpg" alt="Jim Beam" usemap="#prince" /><map name="prince"><area shape="rect" coords="300,170,350,200" onclick="javascript:gotoFirst();" /><area shape="rect" coords="530,245,540,255" onclick="javascript:gotoSecond();" /><area shape="rect" coords="520,180,540,200" onclick="javascript:gotoThird();" /></map></body></html>BTW Something very similar works fine on my website at http://www.stockton.co.za/doc/jones
  5. Sorry guys but now I have another issue.My code now looks like A1 = setInterval(function() {SlideNumbers(Previous, Current)}, 10);function SlideNumbers(PreviousOne, Next) { if (PreviousOne == Next) { clearInterval(A1); } UnitXpos -= 1; PreviousOne += 1; if (UnitXpos < -999) UnitXpos = 0; document.getElementById("Debugger").innerHTML = "PreviousOne = " + PreviousOne + " Next = " + Next; document.getElementById("Unit").style.top = UnitXpos+"px"; if (UnitXpos%10 == 0) ScrollTens(); } and I find that the variable PreviousOne never increments.Both UnitXpos and PreviousOne are defined as global variables. Is this an issue?
  6. Thank you all. It is now working the way I want and I suspect that I now understand what is going on.
  7. The Old Man From Scene 24, sorry my mistake and I have now got your suggestion working for me.
  8. Duotone Fox please explain why the loop is a problem.The Old Man From Scene 24 if I implement your suggestion my script no longer works?
  9. I have implemented the following code, hopefully correctly using your suggestion but I still get no scroll from the reel unless I uncomment the alert(). If I uncomment the alert() the code works exactly as expected. A1 = setInterval(SlideNumbers(Hoogte, xpos), 2000); function SlideNumbers(Proposed, Current) { if (Proposed > 0) Proposed *= -1; if (Current > 0) Current *= -1; while (Proposed != Current) { Current -= 1; if (Current < -999) Current = -1;// alert("Proposed = "+Proposed+" Current = "+Current); document.getElementById("Unit").style.top = Current+"px"; } clearInterval(A1); } Have a look at http://www.k9t.za.net/vicodo/index1.html for a better idea of what I mean by reel scrolling.
  10. I hear what you are saying and what I am attempting is to smoothly scroll from the currently displayed number to the currently correct number and that is why the setTimeout.Sometimes the distance between the two numbers will be large . ie Let us say from 9 thru 0 to 8 and other times less so, let us say from 8 to 9.How would you suggest I achieve this?
  11. In an attempt to build my own vertical scrolling display I have created the following function which works perfectly if I uncomment the alert() but fails to scroll vertically without that alert. function ScrollNumbers(Current) { var xpos = findPosY(document.getElementById("Unit")); if (xpos > 0) xpos *= -1;// alert("ScrollNumbers with "+" "+Current+" " + xpos); var CurrentUnit = parseInt(Current[Current.length - 2]); var Hoogte = 0; var a = 0; var c = 0; Hoogte = ((CurrentUnit)*94); // CurrentUnit can be anything from 0 to 9 Hoogte *= -1;// alert("Entering loop Hoogte = "+ Hoogte+" "+xpos); -700 -302 if (Hoogte < xpos) { while (Hoogte < xpos) { xpos += -1; document.getElementById("Unit").style.top = xpos+"px";// alert("1st Hoogte = "+ Hoogte+" xpos = "+xpos); a=window.setTimeout("c += 1",200);// doTimer(); } } else { if (Hoogte > xpos) // -302 -700 { while (xpos > -999) { xpos -= 1; document.getElementById("Unit").style.top = xpos+"px";// alert("2nd Hoogte = "+ Hoogte+" xpos = "+xpos); a=window.setTimeout("c += 1",200);// doTimer(); } xpos = 0; while (Hoogte < xpos) { xpos -= 1; document.getElementById("Unit").style.top = xpos+"px";// alert("3rd Hoogte = "+ Hoogte+" xpos = "+xpos); a=window.setTimeout("c += 1",200);// doTimer() } } } } What I get is that the new display appears without any delay rather than scroll into position.The way I see it is that the image should scroll from where it is now(xpos) to the new position one px at a time with 200msec between.
  12. Thank you. Unfortunately there is no documentation and the variable names mean nothing......typical........:-(I am going to attempt to do my own version of http://www.devit.co.za/odo/odo.html and see how far I get.What is wrong with http://www.devit.co.za/odo/odo.html is that I have found no way that I can control what the start number is and it also need a method of getting the latest value of that number from the server which I have already coded with Ajax as can be seen at http://www.k9t.za.net/epj/epj.html.If and when I need help I will start a new thread here.Thank you again.
  13. More likely the following code has something to do with it? zxcOdometer.prototype.Count=function(){ var z0=0,ary=this.ary,cnt=1; for (;z0<ary.length;z0++){ if (this.nu%cnt==0||z0==0){ ary[z0].cnt++; if (ary[z0].cnt==11){ ary[z0].cnt=1; ary[z0].now=0; } clearTimeout(ary[z0].dly); ary[z0].animate('top',ary[z0].now,-this.mve*ary[z0].cnt,new Date()); } cnt*=10; } document.getElementById("VoucherNumber").innerHTML = this.nu + " " + cnt + " "; this.nu++; } and if so why the prototype?
  14. Thank you but now does that mean that M1.Count to the 'nth time M1 was executed? or to put it another way please tell me what is the relevance of Count?
  15. Could someone please explain what the following means. M1=new zxcOdometer({ ID:'tst', // the unique ID name of the parent DIV element. (string) CommonClass:'digit', // the common class name of the images. (string) SlideDuration:200 //(optional) the slide duration in milli seconds. (number, default = 500)});setInterval(function(){ M1.Count(); },600); I believe that setInterval(f,t) will execute function f in t milliseconds but what does function(){ M1.Count(); } do?
  • Create New...