Tag: html5

How to clear a rectangle area in WebGL?

WebGL has a clear method that clears an entire surface. What’s the best way to clear just a particular rectangle of the surface? For example I want to set a 100×100 box of pixels starting at (50, 50) to all zeroes (ARGB 0, 0, 0, 0). All I can think of right now is drawing […]

Javascript Game Loop

I have some questions concerning JavaScript loops. Questions : Why does a JavaScript loop freeze the browser Why is the drawing slow even do it’s running at 1 draw every 1ms and it’s drawing the simplest thing! What’s the solution? flash is dying, what do we do now? Here is the canvas code to try […]

Dynamically loading html with jQuery

I’m running into a bit of an issue with this site I am currently building, I am using jQuery’s .load() to grab an html file and include it in the #content of my site <a href=”#” onclick=”$(‘#content’).load(‘port/1.html’)”>1</a> The chunk of code that is being pulled in has a jQuery click function on a few thumbnail […]

Efficient milliseconds display in HTML

The goal: find the most CPU efficient way to display the current milliseconds in HTML. My current solution takes up to 10% CPU computation on my laptop. My current solution: http://dev.timerintab.appspot.com/test/ms My final goal is to display the milliseconds on a timer. UpdateI changed the test to take an argument for the interval: http://dev.timerintab.appspot.com/test/ms?interval=x where […]

Stop user's executing JavaScript from console

I’ve been mucking around creating a little multiplayer game using HTML5 technologies. I used Node.js and Socket.IO to manage server-side business. My problem lies in users being able to enter in their own JavaScript through the Chrome console (and various other consoles im sure). For example, a user might enter this into the console: socket.emit(“new […]

Fixed height for bootstrap pre-scrollable DIV

In my application I have to display bootsatarp grid for database records. Since the number of records count are large enough to view without full page scrolling I wrap my table with bootstrap pre-scrollable div and it gave me the functionality to scroll the table. However all the time DIV size is half of the […]

How to expand child <div> with 100% of body width?

I have something like this: <body> <div style=”width:700px; margin:0 auto;”> <div class=”inner-div”></div> </div> </body> Is there a way to expand child div with class “inner-div”, to 100% of body width?

$.on() bubbling after stopPropagation();

I’m trying to use .on() to tell me what i clicked on inside of a region. To capture the exact element I clicked on, I’m calling event.stopPropagation() to keep it from bubbling but my output is always #containerDiv and its contents. How can I see exactly what was clicked on within #containerDiv? A code snippet […]

html5, what is isContentEditable?

chrome supports the isContentEditable property (lists it in the “Inspect Element”), but reports false for INPUT, FORM – actually, everything. too me, for example, seems that INPUT, non-readonly, should be true. does anybody know what’s going on?

Reading large images as thumbnails locally via HTML5 filereader

I am trying to load local images as thumbnails as explained here. My code is below. This works fine for small images. However, when you try load larger images (e.g. 4mb) there is a huge lag. Is there any way to optimize this? Thanks Html <input type=”file” id=”files” name=”files[]” multiple /> <output id=”list”></output> Javascript <script> […]