JavaScript - Layering Pointers
Its me again .. I am using the jquery script to allow users in select a calender date from the a popup window.
however, when selected, the calender is being displayed underneath the popup windows and not on top. any ideas or pointer on this one as its driving me mad, i've been trying to fix it since 7:30am and still no further forward. please help, many thanks. Similar Tutorialswhy doesn't this work? Code: var d=document.getElementsByTagName; alert(d); //looks ok here alert( d("body") ); //fails So I am working on a project that converts fahrenheit to celcius, or the other way around. So when I click on the radio button for fahrenheit to celcius, it disables the celcius textbox, and the celcius to fahrenheit radio button disables the fahrenheit text box. What I can't figure out is how to get my radio buttons to reset the form to be able to enter another conversion to be made. What it does is locks up both text boxes so that I can't enter anything at all after the first time I do it. Code: <body> <div id="content"> <h1>Convert temperature</h1> <input type="radio" onclick="reset();document.getElementById('degrees_celcius').disabled=this.checked" name="conversion_type" id="to_celcius" />From Fahrenheit to Celcius<br /> <input type="radio" onclick="reset();document.getElementById('degrees_fahrenheit').disabled=this.checked" name="conversion_type" id="to_fahrenheit" />From Celcius to Fahrenheit<br /> <br /> <form id="foofoo"> <label>Degrees Fahrenheit:</label> <input type="text" id="degrees_fahrenheit" class="disabled" /><br /> <label>Degrees Celcius:</label> <input type="text" id="degrees_celcius" class="disabled"/><br /> <br /> </form> <input type="button" id="convert" value="Convert" /><br /> <br /> </div> </body> Code: var temperature = function (){//This f if($("to_celcius").checked == true) { var far = parseFloat($("degrees_fahrenheit").value ); if(isNaN(far)) { alert("Please enter a valid temperature.") return; } var far_cel =Math.round((far-32) * 5/9); $("degrees_celcius").value = far_cel; }else ($("to_fahrenheit").checked ==true) { var cell = parseFloat($("degrees_celcius").value); if(isNaN(cell)) { alert("Please enter a valid temperature.") return; } var cel_far = Math.round(cell * 9/5 + 32); $("degrees_fahrenheit").value = cel_far; } } function reset()//resets the text box fields { $("foofoo").reset(); } window.onload = function(){ $("convert").onclick = temperature; $("to_fahrenheit").onclick = reset; $("to_celcius").onclick = reset; } Code: function sortArrayGo(startingArray, sortNum) { var holder = startingArray; //holder.push(startingArray[0]); var sortedArray = new Array(); var endNum = startingArray.length; //indexPlace=0; for(n = 0; n < endNum; n++) { var min = 0; for(m=1; m<holder.length; m++) { alreadyMin = holder[min][sortNum]; possibleMin = holder[m][sortNum]; if(alreadyMin > possibleMin) { min = m; } } thisLine = startingArray.splice(min, 1); for(cellCount = 0; cellCount < tablePos.length; cellCount++) { colNum = tablePos[cellCount]; dataToInsert = thisLine[colNum]; document.getElementById('dataTable').rows[n].cells[cellCount].innerHTML = dataToInsert; } sortedArray.push(thisLine); } return sortedArray; } i'm sorting a 2d array by whatever column i specify. i know from using firebug that my sorting is working, but it's getting and displaying undefined for dataToInsert and inside of my table, but sortedArray winds up sorted correctly. Hi everyone, I'm trying to capture the order in which the windows I've opened using window.open are layered on top of each other. For example, if I open three windows, starting with the first on the bottom and the third on top, but I then focus on the second window, bringing it to the top, is there a way to capture the new window order (2 on top, then 3, then 1)? I know that window.top can give me the first one, but from there, without closing it, is there a way to tell what the next one underneath it is? Thanks in advance, Katherine |