Jump to content

atar.yosef

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by atar.yosef

  1. Hi there Fellows!! I've encountered at a bizarre behavior at the underneath code snippet. what I've tried to do is to turn on the visibility of the second div element when the mouse hovers on the first div element. and then, when the mouse goes over the second div element, it triggers a CSS animation on the third div element. but strangely, when the mouse hovers on the second div element, it indeed triggers the CSS animation, but the second div element itself disapper although it wasn't requested to do so. can someone here figure out why does this occur and how to prevent it? any help will be appreciated!! thanks in advance!! atar. <html><head><title></title><script type="text/javascript">try{function start(){var divFirst = document.getElementById("divFirst");var divSecond = document.getElementById("divSecond");var divThird = document.getElementById("divThird");divFirst.onmouseover = function(e){divSecond.style.visibility = "visible";}divSecond.onmouseover = function(e){divSecond.style.visibility = "visible";}divSecond.onmouseover = function(e){divThird.style.width = window.innerWidth;}divThird.onmouseout = function(e){divThird.style.width = "0px";}divFirst.onmouseout = function(e){divSecond.style.visibility = "hidden";}}//end start().}//end try statement.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor + "\n and the error stack is: \n" + err.stack);}//end catch statement.</script><style type="text/CSS">div#divFirst {background-color:red;}div#divSecond {background-color:blue; visibility:hidden;}div#divThird {background-color:green; -o-transition:width 1s; -webkit-transition:width 2s; width:0px; overflow:hidden;}</style></head><body onload="start()"><div id="divFirst">my first div!!</div><div id="divSecond">my second div!!</div><br /><div id="divThird">my third div!!</div></body></html>
  2. @ingolme: Thanks for replying!! later yesterday I have noticed that the code indeed worked and it created a folder on my server. probably there was some delay in the server because it didn't show me this new directory after I reloaded the page but only several minutes thereafter. I am just wondered what do we need to do in a case we want to create several directories at once, is there any solution? thank you!! atar.
  3. @ingolme:Thanks for replying.No error messages. Also, this example was taken directly from the php.net site themselves. So it's expected to work even when creating multiple nested directories at once. However, I have also tested this example with only one directory at the directory path and it also didn't work. Maybe I need to use at some wrappers such the "ftp://" wrapper?Thanks in advance!!Atar.
  4. Hi there! I'm very new in PHP and just doing my first steps in this great world. I have copy&paste a code snippet from php.net which demonstrate how to use the mkdir() function.the code snippet was very short: <? mkdir("/path/to/my/dir", 0700);?> I have saved this file into my ftp server with the php extension and then I load this page into my browser.the code didn't work as I expected and didn't create a directory in my server.can someone explain me please what's wrong with this code? Thanks in advance!! atar.
  5. Hi there!!I don't know why, but when I am loading the following code snippet in my iPod touch browser, so when I hit the "Backspace" key, the function is called twice instead of being invoked once. Can someone help me know why does this occur?Thanks in advance!!Atar. <html><head><title></title><script type="text/javascript">try{function myFunction(e){if(e.keyCode==8){alert("The Backspace button has been pressed");}//end if.}//end myFunction().}//end try statement.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor + "\n and the error stack is: \n" + err.stack);}//end catch statement.</script><style type="text/CSS"></style></head><body><input type="text" onkeydown="myFunction(event)" value="something"></input></body></html>
  6. Thanks on your reply, but how can I remove those elements from the DOM?
  7. Try to omit the last else statement. I hope this will work.
  8. Hi there!!Modern browser allow users to specify a JavaScript code that will be executed every time the user load a web site. and my question is: is there any way to block some parts of a web site from being shown by using some JavaScript code? And if yes, so how?Thanks in advance!!Atar.
  9. @ingolme:Thanks you about your response, but again, I still didn't understand why is JavaScript not enable to retrieve this info from the CSS parameters that were set between the two "style" tags.
  10. @Ingolme:Thanks for your answer!! Can you give me a code demonstration please?Thanks in advance!!Atar.
  11. @Ingolme:Thanks you about your response!! But I didn't understand two things in your words:1) This is correct that the width wasn't set in the style attribute but for this purpose I set it in the "<style>" section as W3schools recommend to do in their html tutorial. So why is JavaScript not able to achieve the width property from the CSS's section?2) I tried to do it and the result was: "undefined", why?Thanks in advance!!Atar.
  12. Thanks you! I tried it and it works fine. Thanks to smiles too.
  13. Hi there!!I wanted to know please why does JavaScript fail to get the "example" element width in the following code: <html><head><title></title><script type="text/javascript">try{function start(){alert(document.getElementById("example").style.width);}//end start().}//end try.catch(err){alert("there's an error in this page. \n the error message is:\n" + err.message + "\n the error name is: \n" + err.name + "\n and the error details are:\n" + err.constructor);}//end catch statement.</script><style type="text/CSS">div.example {width:10px; border:solid;}</style></head><body onload="start()"><div id="example" class="example">some text goes here...</div></body></html> Any help will be appreciated!Thanks in advance!!Atar.
  14. @ Don E:Thank you about your kind support!Unfortunately, your example don't meet my needs because you used at string literals as parameters while I need to use VARIABLES as parameters.Thanks in advance!!Atar.
  15. Thanks you about your response. I don't know what are you meaning by 'the delay parameter'. Can you explain yourself in more detail? Also, how can I call to a function by a reference rather than as a string?Thanks in advance!!Atar.
  16. Hi there!!Just wanted to know please, if this is possible to pass A VARIABLE as parameters into a function that is called by the 'setTimeout' function, for example;setTimeout("myFunction(myParameter)", 1000);I tried to do so but with no success. Can anyone help me?Thanks in advance!!Atar.
  17. @ingolme:Thank you about your detailed explanation!!
  18. @ingolme:Thanks you very much about your response, but unfortunately, I didn't understand your words because you spoke too shortly. I didn't understand how does the a and b parameters that passed into the sortNumber() function represent an index in the array. Here they don't use the arr syntax so how can they access to the array's indices?
  19. Hi there!!W3schools has demonstrated how to sort a numerical array using the following code: <code><script type="text/javascript">function sortNumber(a, {return a -b;}var arr = new Array(6);arr[0] = "10";arr[1] = "5";arr[2] = "40";arr[3] = "25";arr[4] = "1000";arr[5] = "1";document.write(arr + "<br />");document.write(arr.sort(sortNumber));</script></code>I just wanted to know how does the sortNumber() function work? What's the meaningful of the a,b parameters which are passed into the function? What are they intended to represent, and how does this snippet: a-b cause to sort the array numerical elements ascending?
×
×
  • Create New...