I am using arrow keys to move an object in my code. Everything works fine except that the mouse cursor disappears when I press any of the arrow keys. How can I make the cursor stay visible? I am using this code check for arrow keys pressed. Answer That’s browser behavior (maybe even OS behavior!), you probably won’t find a
Tag: html
Pure javascript method to wrap content in a div
I want to wrap all the nodes within the #slidesContainer div with JavaScript. I know it is easily done in jQuery, but I am interested in knowing how to do it with pure JS. Here is the code: I want to wrap the divs with a class of “slide” collectively within another div with id=”slideInner”. Answer If your “slide”s are
Event handler returning undefined?
Let’s say I was attaching an event handler of jQuery click event to one of the function of my objects. But why does it return undefined on my properties? Answer You’re passing the function referenced by buttonView.onClick, but it’s association with buttonView is not retained. To retain the reference via this, you can use the jQuery.proxy()[docs] method. Now this in
Get Line co-ordinates in Javascript
I am drawing lines using Canvas (HTML 5), since lines/shapes are not stored as objects in Canvas, I cannot attach unique events to it (eg onmouseclick) I wish to attach a onmouseover event to a line, is it possible by getting to know if the mouse if over a particular line (using its 2 X and 2 Y co-ordinates) in
Removing all script tags from html with JS Regular Expression
I want to strip script tags out of this HTML at Pastebin: http://pastebin.com/mdxygM0a I tried using the below regular expression: But it does not remove all of the script tags in the HTML. It only removes in-line scripts. I’m looking for some regex that can remove all of the script tags (in-line and multi-line). It would be highly appreciated if
Is it possible to alter a CSS stylesheet using JavaScript? (NOT the style of an object, but the stylesheet itself)
Is it possible to alter a CSS stylesheet using JavaScript? I am NOT talking about: I AM talking about altering: besides doing something dirty (which we haven’t tried yet btw), like creating a new object in the head, innerHTML a style tag in there, etc. Although this, even if it did work, would pose a few issues as the style
Is it possible to create an HTML canvas without a DOM element?
I’d like to have an HTML canvas context that I can paint to and read off-screen (in this example, writing text and reading the shape that is created, but it’s a general question). I may also want to use a canvas as an off-screen frame-buffer. I suppose I could create a hidden DOM element but I’d rather create it from
Can I run HTML files directly from GitHub, instead of just viewing their source?
If I have a .html file in a GitHub repository, e.g. for running a a set of JavaScript tests, is there any way I can view that page directly—thus running the tests? For example, could I somehow actually see the test results that would be produced by the jQuery test suite, without downloading or cloning the repo to my local
Data graphing with html [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question A line chart that updates every couple of seconds and doesn’t
How to detect DIV’s dimension changed?
I’ve the following sample html, there is a DIV which has 100% width. It contains some elements. While performing windows re-sizing, the inner elements may be re-positioned, and the dimension of the div may change. I’m asking if it is possible to hook the div’s dimension change event? and How to do that? I currently bind the callback function to