Tagged Questions
-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
83 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
42 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
50 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
51 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
67 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
162 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
215 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
184 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
616 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 ...
-2
votes
2answers
93 views
How do I refactor (DRY) this code? [closed]
I was hoping somebody could help me refactor my Javascript. Due to it's length (500 or so lines) I don't want to post it here. But check it out here on pastebin to let me know how I can improve it ...
0
votes
2answers
86 views
JQuery Slide Show Simplification
I'm trying to come up with the most basic example of making a JQuery slide show where you click on the current image you're viewing and you cycle through a gallery of photos. I know its probably not ...
3
votes
1answer
128 views
JS Beginner: Lack of clarity and structure - refactoring possible? | with code example
Hello to everyone!
First of all, i have to thank everyone who contributes to this great site. It has been a source of many tipps for me while starting to code in javascript!
I've read the FAQs and ...
1
vote
1answer
159 views
Which of the two JavaScript snippets has a better structure?
I sat down to write a demo HTML5-ish page that lets a user to perform following operations on a canvas - draw lines, draw a filled rectangle, and reset the canvas. Each operation is represented by a ...
0
votes
2answers
130 views
Is this decent HTML5 or total garbage? [closed]
So this is my first real try with HTML5 and i'm kinda lost.
Is this an acceptable way to do it? Also, it's a mobile Wordpress theme... i decided to ipost only the final output.
Thank you.
...
1
vote
1answer
182 views
Increasing web load time (coffee script and d3.js) [closed]
I took the Bubble chart visualization from Jim Vallandingham: http://vallandingham.me/vis/gates/ and added a few other features such as: a picture over svg, a click function, option to select only ...
1
vote
0answers
52 views
HTML5 Geolocation check and error management
I've written this code that I've been using for a while now to check for browser geolocation services for google maps applications. I have to say that I am not very happy with it as I've had to hack ...
2
votes
0answers
111 views
How to optimize this HTML5 animation?
I'm just learning the basics of animating with Javascript and HTML5. I'm trying to create this scrolling logos element for my site, and I'm pretty sure that my code is very inefficient. Can anyone ...
3
votes
1answer
119 views
Can this Drag and Drop Script be Optimized to Perform Better?
I've just finished a week long adventure of creating an HTML5 Drag and Drop scheduler. As the prototype stands it works fine, but I'm curious if some of the code can be optimized. I mostly focused on ...
1
vote
1answer
226 views
JavaScript switch statement to make an AJAX call
I have a button group that looks like this:
The user selects one of the options and they can search for a person based on that criteria.
I wrote a switch statement that populates the URL to make ...
1
vote
1answer
137 views
Can this javascript with jquery be improved?
I recently started learning jquery and javascript and put this together for the site I work on here.
/*
* Manages the error report popups
*
* written by Tom Jenkinson
*/
...
1
vote
1answer
96 views
Is there a better way of detecting when the contents of a web page changes in js?
This is the code I'm using at the moment
/*
* Adjust content height so that it always fills browser height
*
* written by Tom Jenkinson
*/
jQuery(document).ready(function() {
...
1
vote
2answers
526 views
Markers on Google Maps
I am newbie at JavaScript, I am using PHP to get data from a MySQL database, and use the data to drop multiple markers into google map. Please give me some suggestion to my code, really appreciate for ...
2
votes
2answers
303 views
Javascript Getters and Setters for localStorage
i have written the following get/set for a username which is stored in local Storage. Do you think this "buys" me anything or even perhaps has major disadvantages? I have never liked relying on ...
-1
votes
1answer
94 views
Javascript, providing arguement alternatives
Is this bad coding? Is it OK to use 'OR' to specify argument alternatives?
// This function will throw an error if it has no arguements and local stroage is not available
var ...
2
votes
3answers
414 views
Can I get some constructive criticism on my HTML5 / Javascript pong game?
I am nearly done developing my pong game (made in HTML5 / Javascript), and I would like some constructive criticism on my code.
Please note that this is the first major coding project I have ever ...
3
votes
1answer
241 views
Better JavaScript code structure and html5 drap and drop?
This little script makes list items selectable and draggable. I'm pretty new to programming in general, and even more so to Javascript. Most of my background is in PHP and some C++. On the large, I ...