Jump to content

Matej

Members
  • Posts

    185
  • Joined

  • Last visited

Everything posted by Matej

  1. Matej

    Table editor

    The link in my second coment is where i already fixed it anyway thanks for answers
  2. Matej

    Table editor

    well , i noticed there was a mistake in script , but even tho i fixed it , i have to press button twice to actualy remove the cell , my guess is that the first press is removing #text node and not actual node , so i repalced childNodes with children , http://jsfiddle.net/dw0pck23/3/ here it is
  3. Matej

    Table editor

    Hello , i have table editor here > http://jsfiddle.net/dw0pck23/ < but the last function does not work . First you chose which cell you want to remove and than you chose on what row. But function zmazbunku() does not work , it always writes Cannot read property '4' of undefined the "4" is basicly value of the first input-1 Can someone help me with this? , thanks for answers at h
  4. i mean , you cant move image where you want with that , you can put or drag it to selected area and even you cant move it in that area
  5. yes , but it does only work for selected elements or?
  6. Hello , i found drag and drop tutorial but i didnt get one thing here is the link - http://luke.breuer.com/tutorial/javascript-drag-and-drop-tutorial.aspx - (if you are too lazy to open it i can copy the code ) So back to my question as first he defines var _startX = 0; than in mousedown invoking function he redefine it like this _startX = e.clientX; so now starX does not equal 0 but location of mouse in X lineand in mousemove invoking function he does this _dragElement.style.left = (_offsetX + e.clientX - _startX) + 'px'; 1)basicly _offsetX=event.target.style.left; 2)e.clientX = position of mouse in X line 3)_startX = is also position of mouse in Xline; so that means that 1)500+2)1000-3)1000 = 500 , so it shouldnt even move could someone please explain it? or if i got it wrong also explain it , thanks for answers
  7. Hi , i have this little stuff here http://jsfiddle.net/gq5x1dpe/2/ and i want button to automaticly change innerHTMl when its margin-left=30px or 200px , i tried to invoke "torek()" as setInterval ,1000 in the button.onclick function but it was glitchy/bugged/broken , could anyone please help me? thanks
  8. Thanks it helped me althought i have another "problem" . Here http://jsfiddle.net/96eLrn6e/ it seems like the function is omitting the last number in the first input , for example if 1st input value = 2 , the 2nd input value should = 3 , but in this case it = NaN; but when 1st input value=22, the 2nd input value = 3 so basicly its like omitting the last number .
  9. Hi , i have input <input id="lol" type="text" name="form_number" size="20" onkeypress='return isNumberKey(event)'> and you can only write there numbers from numpad keyboard - i have it with this script function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; if ((charCode < 58 && charCode > 47)) { return true; } else { return false; }} But what if i want it to do another function on kezdown/keypress? is it possible? for example another function , can i set keydown and at the same time keypress in the same input?
  10. Matej

    padding

    Hello , im building drop down menu here http://jsfiddle.net/f0b2tu1x/24/ if you :hover on products , the menu appears but its not exactly "under" the products , its width its smaller , i was trying to fix it with padding or margin but nothing works , can somebode please help me?
  11. Matej

    calculator

    also i would like to do the thing , that you can use "-" only twice in a row , but function ahoj(plot){if( x.value.lastIndexOf(plot)!=x.value.length-2){ x.value+=plot;}} any hint?
  12. Matej

    calculator

    well , did it like this http://jsfiddle.net/7D9gR/7/ // Haidien your fiddle is interessting , but im not very good at OOP yet
  13. Matej

    calculator

    thanks , did it like this http://jsfiddle.net/7D9gR/4/ // the .value always returns string right?
  14. Matej

    calculator

    even when i dont use this function like here http://jsfiddle.net/7D9gR/1/ , the value isnt "updating" , for example when value is 7 and i click on 8 , it doesnt make 78 but 8 replaces 7
  15. Matej

    calculator

    Hi . im trying to do a calculator but this function does now work with error "Cannot set property 'value' of null " while i deffinet it earlier... http://jsfiddle.net/7D9gR/ can someone help<
  16. var x=0;for(var i=0;i<10;i++){ if(i%5==0){continue} x++;}alert(x) why does x=8 here? shouldnt be it 9? when i=5 the loop exits(omiting increment) and continues which means when i=5 x=5 also , so x should have end as 9.
  17. Matej

    pop up box?

    thanks thought i had to use more of js...
  18. Matej

    pop up box?

    Hi , how can i do (or how its called) a window , which on load will ask me some question or tell me some message , and after aj close it or "accept" it , it will let me go to the site? without URL change.
  19. oh , basicly lastime isnt updated , silly me
  20. Thanks , but this function seems wierd to me function init() {var lasttime = null; //this variable is a static localfunction dtime(){var now = new Date().getTime();var delta;if (lasttime == null){ // this is true so delta will be 0 on the first invoke , delta = 0;}else{delta = now - lasttime; //on the second and so on invokes this is true , but shouldnt this equals to 0 also? basicly now=new Date().getTime() and "lasttime"=now , so it should equals 0 shouldnt it?}lasttime = now;// update the static local vardocument.getElementById("out").innerHTML = delta + ' milliseconds';}document.getElementById('btn1').onclick = dtime;}//end of init window.addEventListener('load',init, false);
  21. Hi , what is(are) function enviroment and scope? This is the first time i hear something like that . Im asking because of this example http://jsfiddle.net/v7gjv/1/ and the text that explains why is there makeHelpCallback closure. "The reason for this is that the functions assigned to onfocus are closures; they consist of the function definition and the captured environment from the setupHelp function's scope. Three closures have been created, but each one shares the same single environment. By the time the onfocus callbacks are executed, the loop has run its course and the item variable (shared by all three closures) has been left pointing to the last entry in the helpText list." Thanks for answers
  22. thats it! thanks you very much
×
×
  • Create New...