0
votes
1answer
6 views

eventlistener and dispatchevent in the same widget

I have a widget which includes an event listener: var MyWidget = function(parseTreeNode,options) { this.initialise(parseTreeNode,options); this.addEventListeners([ {type: "tw-my-message", ...
0
votes
0answers
24 views

Javascript Mouseover Event Cause Element Blinking

What I intend to do is : The little square will move over the picture as the mouse move. document.getElementById("small").onmouseover=function(e){ var x=e.offsetX,y=e.offsetY; var ...
0
votes
1answer
18 views

Delayed Filtering

I'm trying to do a delayed filter in Javascript. Basically I have a textbox whereby the user inputs his search term. However, I do not want to filter the data on each keypress, but rather wait 3 ...
0
votes
1answer
32 views

Setting up an associative array in JavaScript

I have this code: var mydata = []; $.each(divs, function(idx, val){ var dID = $(val).attr("id"); mydata[dID] = new Array(); ...
0
votes
5answers
37 views

Prevent successive clicks binded on a div with jquery

I am playing with a slider script. In the script, left and right arrow wrapped in a div and click event binded over the div. It works no problem, but what I need when it clicked on the div, I need to ...
0
votes
1answer
26 views

Force directed layout legend text mouseover

With the Mobile Patent Suit example by Mike Bostock as an example, i want to create mouseover event on legend. i want the script to work since i am new to javascript Ex: <div ...
1
vote
3answers
42 views

Adding Event Listener to dynamically created divs

I am trying to add click event listener to my divs that I am creating in my JS dynamically. My Javascript snippet of function that is called each time to create the Div: var listDiv = ...
0
votes
1answer
42 views

build a li tag string in javascript

I'm having trouble figuring out why this wont output correctly, the script is supposed to out put a list of each multiple within the range given from the user , how ever, I get no action on the ...
0
votes
1answer
49 views

jQuery trigger() with keydown/up event on textarea

JSFiddle here - uses console.log(). window.evtqueue = []; window.eventHold = function(e){ console.log(e.held); if (typeof(e.held)==typeof(undefined)){ e.held = 1; ...
2
votes
1answer
29 views

move the mouse infinitely

I'm trying to do a game with Babylon, and i have a little problem with the camera. Basicly, I want (like in all FPS) the camera to be infinitely moving and not stopping when the mouse reach the edge ...
1
vote
1answer
23 views

Preventing a running event from execution in javascript/jQuery

I am having a drop down as follows. <select id="mySelect"> <option value="one">one</option> <option value="two">Two</option> </select> I am having a change event ...
0
votes
2answers
25 views

How to detect onscroll event on an iframe? the iframe's source is of the same domain of the page

The plan is not to have a scroll bar to the iframe that i am adding to my page. So the idea to do it as i thought is to have a onscroll function. So whenever a user scrolls the iframe, i will call ...
0
votes
1answer
16 views

Trying to understand what is causing this JavaScript bug

I have an element X that, onclick, initializes/updates a printControl as such: printControl.init(tab, source, location, start_month, end_month, year); Here is the relevant code for the ...
0
votes
1answer
15 views

wrong pageY calculation when parent div has position:relative

e.pageYdoesn't give proper result when parent div has position:relative css property Demo: http://codepen.io/anon/pen/mDBzy At the same time result seems to fine without position:relative of the ...
0
votes
2answers
68 views

Do something when all dynamically created images have loaded

So what I'm trying to do is create a dynamic wall of images. What I'm doing is this: Call an API to get some response. Create an array of objects based on response Based on the array, make HTML ...
0
votes
1answer
20 views

javascript conflict between onmousedown and onmousemove

I have developed a volume controller in pure javaScript. mouse move works fine but unfortunately I am unable to make it a perfect volume controller. There are two issues facing on the function ...
0
votes
2answers
26 views

Javascript initEvent not Firing More than Once

I am creating Chrome extension where I create custom event called 'STATUS' in my html page.. var evt = document.createEvent("Events"); evt.initEvent("STATUS", true, false); ...
-1
votes
1answer
34 views

How to select dynamically created ajax element

Quick question. I've got html code like that: <li class='entry'> <div class='entryContent'> <p class='entryText'>Entry text></p> <a href="#" ...
0
votes
1answer
27 views

Javascript onresize event not firing

I'm trying to adjust the border width of my background image when the browser is resized. I'm calling that function onload and onresize. Unfortunately only the onload one is being called. So when I ...
0
votes
1answer
21 views

How to close the jquery context menu

I'm displaying a contextmenu in jquery, but am unable to close it. These are the events that I am registering: function openContextMenu(event) { event.preventDefault(); $("#custom-menu") ...
0
votes
0answers
20 views

Input type=color event on color picker window closed

Using neat html5 feature color input: <input type="color" ... Google Chrome browser provides a nice little color picker window for it. Is any particular event emitted when color picker popup ...
0
votes
0answers
47 views

How to close a div by clicking anywhere outside the div and not inside [duplicate]

I have implemented the following piece that works almost everywhere on the page. $(document).click(function(event){ if($("#div_to_close").is(":visible")){ $("#div_to_close").hide(); ...
-1
votes
2answers
24 views

How to prevent the click events from piling up when assigned with JQuery multiple times?

I have a dynamically created list and I want to add for all its elements a click event on a delete button. Every time I add an element to the list, I add an event to all the list elements, but for ...
0
votes
0answers
17 views

Differentiate between same event type within a method of on object

Simple question: How can I differentiate between the two event types in this object if they are the same type? As you can see below, its easy enough using the switch statement switch(e.type) because ...
0
votes
2answers
41 views

Hiding multiple form fields using checkboxes

I have this code that I need to edit so I can use it on multiple chkBox's and txtBox's. Currently I can only hide one input field with one check box. I know HTML and CSS but I am not familiar with JS. ...
0
votes
0answers
7 views

Creating Wrapper/Controller for a Chrome Extension

I have an existing chrome extension that works on its own, but I want to wrap it and run it conditionally. Basically, the user for the new extension would get a popup with three options-- if he/she ...
1
vote
1answer
46 views

Why call removeEventListener inside addEventListener callback?

I have downloaded a JS starter template. It has a default.js file like this: (Of course the js file is referenced in an html page that contains just an <a> element.) (function () { "use ...
0
votes
0answers
15 views

How to Save the Changes on Page Navigation on datatable plugin?

I'm using datatable plugin on my html table for pagination and sorting purpose i'm having dropdownlist in the table cells which is editable by the user.I want to save the changes and display alert as ...
0
votes
0answers
12 views

Selecting multiple polygons, intuitively

When using Google Maps JavaScript API v3, I would like to support an event in the GUI, where users can select multiple polygons intuitively, by "Shift + Left click" one by one, or by "Click & ...
0
votes
1answer
31 views

keyup event not triggered for escape key

I have a text input field referred to as $nameEditor. I want to show this text field when a button is pressed, and hide it on blur or when the escape key is pressed. Hiding the field on blur works ...
0
votes
1answer
42 views

to make the second div slide from top to bottom

I am working on hide and show functionality... i have one bug in my code.. when i click the first div...the content is opening from down to top... where as when i click the second div it opens from ...
1
vote
6answers
59 views

Remove click event handler immediately after click

I've been trying to remove the click event handler after being clicked once to prevent the event from firing multiple times. I've tried .unbind(), .off(), .one() and put each in various different ...
0
votes
0answers
8 views

Sharing an event dispatcher between two windows in Javascript

I'm developing an app in IE8. The main window opens a new window and keeps a reference to it. When the new window is initialized I call a function in the second window and provide a reference to an ...
0
votes
0answers
32 views

Manually calling a prevented browser-default event

Is there a way (using jQuery or otherwise) to manually trigger a browser default action that can be / was prevented by event.preventDefault()? My specific use-case is as follows: The context-menu is ...
-1
votes
1answer
48 views

Show and hide for two different <div> elements

I am working on hide and show functionality. When I click the wireless it should open the corresponding div element. When I click one li it opens the corresponding div. I am getting the error: cannot ...
0
votes
1answer
45 views

How to change Javascript values without page load

I am working on time counter. There is bidding happening for a product which is supposed to end at 4PM. But at 3PM organizer decides to change the time to 5PM. Now new time (of bidding end) we are ...
0
votes
1answer
32 views

How to avoid repeats of javascript events?

I'm new in JS and I have some difficulties with the using events. My problem is that the event is repeated more than once. I use socket.io for my simple game. Here is my code: socket.on("permit", ...
-5
votes
2answers
41 views

open the div on click of li using click events [closed]

I have list of links when i click the link.. i need to open the content div... i am trying it to write in jquery.. can you guys tell me how to write it.. providing my code below... ...
0
votes
0answers
46 views

ToolTip only shows on “Click”- google charts

Friends, After several hours of searching for an answer I am unable to fix my problem. I am working with latest jQuery and Google's API visualizations. On page load, the ColumnChart renders ...
2
votes
1answer
25 views

javascript : extending native element click event

the jsbin : http://jsbin.com/weqitiwe/1/ Hi, most coder around the world avoid extending native javascript object. But, it always fun to work out of the rule. Some of the new native method works. ...
0
votes
3answers
17 views

Is there a way to check an element's attribute when using Event Delegation?

Using Event Delegation, is there a way to check the element that was fired if it has a particular attribute or specifically a class or an ID? <ul> <li><button>Make the first ...
2
votes
2answers
55 views

Escape Key-press event lingering from previous action

I have a custom made dialog box written in javascript, it has a key listener to close it if someone hits the escape key. $(window).on( "keyup", function(e) { var code = e.keyCode || ...
1
vote
1answer
42 views

how to properly handle an onclick event in conjunction with an onblur

The following post relates to a previous question I asked here. Although the 2 problems are independent they do relate to the same feature that I implementing - predictive text. The problem I am ...
0
votes
0answers
31 views

Communicating with injected .js files

I'm trying to make a simple Chrome extension that controls Youtube. I injected the script that directly controls Youtube with Method 1 of Building a Chrome Extension - Inject code in a page using a ...
1
vote
1answer
36 views

Javascript href change on onChange event

I got the below script: function sele(dropdownlist, button) { var url = dropdownlist.value; if (url !== "") { button.href = url; } if (url === "null") { ...
0
votes
0answers
31 views

javascript, check if current tab is active from iframe

I have a page that contains iframe. iframe contains a javascript that should handle two cases: tab becomes active and tab becomes inactive. I have such code: //by default tab is active ...
-3
votes
0answers
18 views

Jquery simulate keyboard input

Is it possibile to simulate a keyboard input with javascript / jquery? I did not mean just to trigger an event, but also to type chars if I'm firing a readable char or delete it if I'm firing ...
0
votes
1answer
43 views

JavaScript Function Issue (dates)

I'm having issues with my JavaScript code. I need to make code that does the following: Click an image twice within 3 seconds to make the image disappear Click it once to reappear I've got it ...
0
votes
4answers
41 views

How to get the count of checked rows of a table on a button click using jquery?

I'm working with Asp .net MVC3 following is my table, <table id="myIndiaTable"> <thead> <tr> <th>Select All<input type="checkbox" class="chkhead" ...
1
vote
2answers
23 views

Drop event only fired once from DIV, but fires always from document

I got a div container which should trigger an event when a file is dropped on. It works perfectly fine, but only ONCE! When i want to drop a secound file on the div container, it navigates to ...