Jump to content

e.shekari

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by e.shekari

  1. I have changed my code. I will write it again to see whether or not i have make a mistake and tell you the result. In new version of my code for (i = 0; i < imgsNo; i++) { newdiv.appendChild(tempArray[i]); } is used and works correctly.
  2. Yes. in case of moveRight I have to write code below in repalceImgs: for (i = 0; i < imgsNo; i++) { newdiv.appendChild(tempArray[i]); } but for SelectFun : for (i = 0; i < imgsNo; i++) { newdiv.appendChild(tempArray[0]); }
  3. tempArray in moveRight holds references to image elements on the page so it actually contains existing nodes on the page. Therefore appendchild function should remove tempArray elements from the page in both cases. I think there is no difference between tempArray in moveRight and imageArray in selectFun. Both of them are an array that holds references to image elements on the page. when they are passed to repalceImgs there is no difference between them so in both cases appendchild should add each image to newdiv and remove it from the page.
  4. Hello. I can not understand why appendChild behaves in two different ways in my code. i have used appendChid in function below: function repalceImgs(tempArray,imgsNo,curIndex){ var x = document.getElementById("container").getElementsByClassName('pics'); var newdiv = document.createElement('div'); newdiv.setAttribute('id', 'pics'); newdiv.setAttribute('class', 'pics'); for (i = 0; i < imgsNo; i++) { newdiv.appendChild(tempArray[i]); } x[0].parentNode.replaceChild(newdiv, x[0]); var srcString = tempArray[curIndex].src; srcString = srcString.replace("small", "big"); var x = document.getElementById("container").getElementsByClassName('big-image'); x[0].src = srcString; } I call replaceImgs function from two different functions. one of them is moveRight function with code below: function moveRight(){ imageArray = getSmallImgs(); imgsNo = imageArray.length; curIndex = findCur(); tempArray = new Array(); for (var i = 0; i < (imgsNo - 1) ; i++) { tempArray[i + 1] = imageArray[i]; } tempArray[0] = imageArray[imgsNo - 1]; for (var i = 0; i < imgsNo; i++) { if (i < 3) { tempArray[i].style.display = "inline"; } else { tempArray[i].style.display = "none"; } } imageArray[curIndex].style.borderWidth = "thick"*/ curIndex++; repalceImgs(tempArray,imgsNo,curIndex); } the other function is used as click event on a picture with code below: function selectFun (){ imageArray = getSmallImgs(); imgsNo = imageArray.length; curIndex = -1; for (var i = 0; i < imageArray.length; i++) { if(imageArray[i] == this){ curIndex = i; } } repalceImgs(imageArray,imgsNo,curIndex) } When repalceImgs() is called from moveRight() the appendChild function adds the items in the tempArray to the newdiv but the items are not removed from tempArray. When repalceImgs() is called from selectFun() the appendChild function adds each item in the tempArray to the newdiv and the added item is removed from tempArray. I can not understand why this happens. I think appendChild() should work the same in these two cases.
  5. Hi. I tried to install eyeOs but during the installation when the setup checks for the requirements, it says that SQLite extension is not installed. I googled for SQLite Instalation but I couldn't understand how to get and install it. I think its hard to do. Where can i get this extension? and How to add it to php?
  6. Hi I'm going too choose a JavaScript GUI-related (widget) libraries as the best one which meets the requirements of a web desktop. But there are lots of these libraries and its hard too choose one. 1.EXT JS 2.qooxdoo 3.Dojo 4.YUI 5.Ample SDk 6.DHTMLX and many many others. I'm confused and i can't decide which one too choose. Ext JS and qooxdoo seems to be the leaders in this context. Can anyone help me about which one too choose? Which one of them has more features? easier to use and extend?
×
×
  • Create New...