Tagged Questions
2
votes
1answer
26 views
Replacing simple jQuery methods for better use
There are a few common jQuery call I find my self calling when creating my app. I need some help and maybe a better way to do all this or rewrite it.
1) Singleton Selector
If I want to select only ...
3
votes
1answer
50 views
Collision detection accuracy
How do you guys think I can improve the code for collision detection on my website asteroidfield.eu5.org? The current code is
var dx = Math.abs(c1.getcx() - c2.getcx());
var dy = Math.abs(c1.getcy() ...
-2
votes
0answers
17 views
I need help getting my footer to not cover my content when I resize the browser [closed]
I've used this Sticky Footer solution to get my footer to stick to the bottom of my page even when the browser is resized. So this is what I have now:
My header, main content, and the footer. Now, as ...
5
votes
2answers
85 views
Do not select elements that contain data attributes
I have a selector that pulls in all anchor tags that start with the # symbol. I am trying to add a :not selector of some form for elements that have a data attribute. I know I could do the ...
1
vote
1answer
48 views
Javascript canvas interactive chart - how to make my code shorter
I'm trying to teach myself javascript and HTML5, (just beginning), and for some practice with canvas I am trying to turn this chart into an interactive chart on canvas, whereby clicking on a word ...
2
votes
1answer
83 views
Game runs very slowly - optimization
I've made my first simple game in HTML5. Unfortunately, it runs so slowly. But there are only few rectangles! On my PC, frame rate is between 20 and 25. I expected something like 60-70 but no 20! You ...
2
votes
1answer
54 views
Edit/Details form in JavaScript
I have a Edit/Details form which has 4 user related fields. On click of Save, I save the edited fields to local storage (if supported) and display the same values in the Details view.
Below is the ...
1
vote
0answers
55 views
JQuery Drag Div Code Simplification
My code allows for the user to move a div around a container div by clicking and dragging the top, much like a window on a desktop. It does this by waiting for mousedown then mousemove, getting ...
1
vote
2answers
72 views
Playing sound on a button click
I am new to javascript and want to make sure I am on the right track when playing a sound. Is there anything I should not be doing better or not be doing at all. Below is a simple function.
...
3
votes
4answers
197 views
Using Javascript FileWriter with minimal use of closures
I'm currently writing a WebGL HTML5 game, and large part of the game initialization involved loading assets streamed over a websocket, and saving them to disk using the FileSystem API.
As part of ...
3
votes
1answer
233 views
Javascript/Canvas Game Dev (pong)
This is the first time I've written javascript in this way (previously all I've done mostly is DOM manipulation and form validation in vanilla and jquery).
I've begun working on a basic pong game. ...
2
votes
1answer
39 views
Web App Structure & User Adjustable Settings
I'm working on my first web app and would like some feedback on the code I have completed. I asked for a similar code review a few weeks ago but I have since improved my structure and added some user ...
4
votes
1answer
94 views
This blueprint has already become a mess, please suggest some restructuring
I'm particularly concerned about where I have declared the functions, can I move them around to clean up the code without breaking anything? The "conjugate" function contains a lot of stuff that has ...
2
votes
1answer
186 views
Structuring Simple HTML5 / CSS3 / JavaScript Math Web App
I am new to web apps and I am having a difficult time structuring my apps. I put together a very simple math web app which I wish to expand on. The app has the following pages/screens:
Home screen
...
3
votes
1answer
736 views
Using Javascript to add and delete rows from an HTML 5 form
I am a Javascript beginner. Here's a fictional example which isolates the functionality mentioned in the subject line. I hope to employ this functionality as part of a larger web application in the ...