Click here to Skip to main content
15,906,645 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Formatting Numbers to Local Settings Pin
Nagy Vilmos31-May-12 4:06
professionalNagy Vilmos31-May-12 4:06 
GeneralRe: Formatting Numbers to Local Settings Pin
Manfred Rudolf Bihy31-May-12 4:19
professionalManfred Rudolf Bihy31-May-12 4:19 
QuestionExtJS Pin
RameshChTulal29-May-12 1:28
RameshChTulal29-May-12 1:28 
AnswerRe: ExtJS Pin
thatraja4-Jun-12 17:18
professionalthatraja4-Jun-12 17:18 
QuestionUpdate DIV text by Javascript Pin
iucaa27-May-12 10:06
iucaa27-May-12 10:06 
AnswerRe: Update DIV text by Javascript Pin
Sandeep Mewara27-May-12 19:58
mveSandeep Mewara27-May-12 19:58 
GeneralRe: Update DIV text by Javascript Pin
iucaa29-May-12 10:20
iucaa29-May-12 10:20 
Questionimplement double click event on Div child elements Pin
Steve Holdorf27-May-12 2:18
Steve Holdorf27-May-12 2:18 
I am trying to implement the double click event on a child element of an autocomplete text box. I can assign the ondblclick to the div but when I double click the innerHTML shows all of the child elements and not the one I double clicked on. See the code below:

var aStr2 = new Array("computer - Plain IA", "computer - Plain JSOC", "communication - Plain IA", "condor - Plain IA");

function AutoComplete(oText) {
// initialize member variables
this.oText = oText; // the text box
this.oDiv = document.getElementById("acdiv"); // oDiv; // a hidden
for the popup auto-complete
this.nMaxSize = 30;
this.aStr = new Array(5);
this.aStrx = new Array(5);
this.aStr3 = aStr2;


// preprocess the texts for fast access
var i, n = this.oText.value.length;

for (i = 0; i < aStr2.length; i++) {
this.aStrx[i] = aStr2[i];
}

this.nCount = this.oText.value.length;

// if a suitable number then show the popup-div
if ((this.nMaxSize == -1) || ((this.nCount < this.nMaxSize) && (this.nCount > 0))) {
// clear the popup div.
while (this.oDiv.hasChildNodes())
this.oDiv.removeChild(this.oDiv.firstChild);

// get all the matching strings from the AutoCompleteDB
for (i = 0; this.aStr3[i] != null; i++) {
if (this.aStr3[i].indexOf(this.oText.value) == -1) {
delete this.aStrx[i];
}
}
// add each string to the popup-div
var i, n = aStrx.length;
for (i = 0; i < n; i++) {
var oDiv2 = document.createElement('div');
//debugger;
oDiv.appendChild(oDiv2);
if (aStrx[i] != null) {
oDiv2.innerHTML = aStrx[i];
}
oDiv2.onmousedown = AutoComplete.prototype.onDivMouseDown;
oDiv2.onmouseover = AutoComplete.prototype.onDivMouseOver;
oDiv2.onmouseout = AutoComplete.prototype.onDivMouseOut;
this.oDiv = oDiv2;
this.oDiv.style.visibility = "visible";
this.oDiv.style.color = "Black";
this.oDiv.style.background = "Yellow";
}
}
else // hide the popup-div
{
this.oDiv.innerHTML = "";
this.oDiv.style.visibility = "hidden";
}
}


AutoComplete.prototype.onblur = function () {
this.oDiv.style.visibility = "hidden";
}

function dblclick() {
// debugger
alert("hello");
}

AnswerRe: implement double click event on Div child elements Pin
Steve Holdorf28-May-12 7:14
Steve Holdorf28-May-12 7:14 
QuestionJava Script moveing a picture around the screen Pin
Boaz Yaari26-May-12 5:00
Boaz Yaari26-May-12 5:00 
AnswerRe: Java Script moveing a picture around the screen Pin
Ali Al Omairi(Abu AlHassan)26-May-12 20:57
professionalAli Al Omairi(Abu AlHassan)26-May-12 20:57 
GeneralRe: Java Script moveing a picture around the screen Pin
Boaz Yaari27-May-12 10:43
Boaz Yaari27-May-12 10:43 
GeneralRe: Java Script moveing a picture around the screen Pin
BobJanova28-May-12 23:34
BobJanova28-May-12 23:34 
GeneralRe: Java Script moveing a picture around the screen Pin
Boaz Yaari27-May-12 11:22
Boaz Yaari27-May-12 11:22 
GeneralRe: Java Script moveing a picture around the screen Pin
Ali Al Omairi(Abu AlHassan)28-May-12 0:38
professionalAli Al Omairi(Abu AlHassan)28-May-12 0:38 
AnswerRe: Java Script moveing a picture around the screen Pin
Ali Al Omairi(Abu AlHassan)31-May-12 7:40
professionalAli Al Omairi(Abu AlHassan)31-May-12 7:40 
GeneralRe: Java Script moveing a picture around the screen Pin
enhzflep31-May-12 10:38
enhzflep31-May-12 10:38 
GeneralRe: Java Script moveing a picture around the screen Pin
Ali Al Omairi(Abu AlHassan)1-Jun-12 1:15
professionalAli Al Omairi(Abu AlHassan)1-Jun-12 1:15 
AnswerRe: Java Script moveing a picture around the screen Pin
enhzflep29-May-12 10:41
enhzflep29-May-12 10:41 
QuestionHow to change mouse cursor in jQuery UI resizable plugin? Pin
Tesic Goran25-May-12 0:06
professionalTesic Goran25-May-12 0:06 
AnswerRe: How to change mouse cursor in jQuery UI resizable plugin? Pin
Ali Al Omairi(Abu AlHassan)29-May-12 5:08
professionalAli Al Omairi(Abu AlHassan)29-May-12 5:08 
QuestionA Unique Problem - Ignoring Placing Page on Back Button History Pin
OrangeV24-May-12 5:40
OrangeV24-May-12 5:40 
AnswerRe: A Unique Problem - Ignoring Placing Page on Back Button History Pin
Sandeep Mewara24-May-12 9:02
mveSandeep Mewara24-May-12 9:02 
QuestionHow to make the text box draggable using jQuery? Pin
Tesic Goran23-May-12 8:45
professionalTesic Goran23-May-12 8:45 
AnswerRe: How to make the text box draggable using jQuery? Pin
Vitaly Tomilov24-May-12 16:13
Vitaly Tomilov24-May-12 16:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.