HTML5 is the latest revision of the HTML standard, including many new syntactical features and several APIs that support drawing, video, audio, etc.
1
vote
0answers
43 views
Slim JS and jQuery because of bad performance
Could someone help me slim down this script a bit?
var _min_width = 470;
var _min_height = 330;
var _which;
var _fyle_type;
var _file_name;
var allowed_types = new ...
-2
votes
4answers
93 views
Writting HTML5 with JavaScript, quickly and easily [closed]
I have wrote a small libraray which is named html5.js. What it acctually does is what it has functions named by the named of almost every available HTML tag.
I have created a GitHub repository for ...
3
votes
1answer
72 views
CSS code organizing
I like to keep my code organized. Usually in several files. Is it good for css.
For instance:
I have three files.
First - layout.html, this is the main template.
Second - grid.css is style sheet ...
2
votes
2answers
61 views
Having less code for the current program
I am was writing a practice program in javascript and it turned out to work quite alright, however I am not entirely happy with the code. I can't shake the feeling that there is a lot of code which ...
4
votes
2answers
105 views
Strict and clean HTML and CSS for teaching website
We are in the proces of creating a book with the purpose of teaching people the art of html and css to create a website from scratch. In our book the focal point, so to say, is that the reader is ...
1
vote
1answer
64 views
Toggle HTML elements' visbility based on selected checkbox(es)
I want to toggle button visibility based on values a user selects within a group of checkboxes.
For example, the user may be given a group of checkboxes with colors:
<input type="checkbox" ...
0
votes
1answer
41 views
Is the HTML5 markup right implemented and semantically correct?
I was asking if the following code has a correct semantically markup, or can it better, and so yes, how:
<!-- Start container website -->
<header id="header">
<div ...
2
votes
1answer
39 views
JavaScript playing different audio files based on video keyframe
the general idea of function below is to load a different sound file depending on current time position of the video. I have the following information about audio files:
var samples: [
['00:00:05', ...
1
vote
1answer
93 views
Using a single for loop to load multiple images in a canvas, better method?
I was just wondering if there's a better way to do this? If I ever have to worry about earlier images not being loaded before the later images, i.e. image[3] being loaded after image[21]. Any ...
3
votes
2answers
73 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 ...
-1
votes
1answer
40 views
How do I make my header title and slogan parallel to my navigation and my logo parallel to my title and slogan? [closed]
This is what I'm trying to do:
jFiddle Example:
http://jsfiddle.net/JordanSimps/hgwyS/
HTML:
<body class="body">
<header class="mainHeader">
<nav><ul>
...
3
votes
1answer
56 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() ...
1
vote
2answers
80 views
Update HTML4 to new HTML5 Semantic/Structural Elements
So im trying to update my websites code to the new HTML5 Semantic/Structural Elements,
but im not very sure with the sections and article element.
So here the structure of my page:
<body>
...
5
votes
2answers
91 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 ...
2
votes
2answers
83 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
86 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
77 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 ...
3
votes
1answer
56 views
Semantically correct markup at practice
I'm writting a mark up for:
And here is my HTML:
<div id="container">
<header>
<h1><img src="images/logo.png" alt="Jessica Priston - ...
1
vote
0answers
74 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 ...
2
votes
2answers
222 views
HTML5 semantic layout (div, article, section) and explicit identifiers
I'm writing a markup for:
And I've split it for these sections:
<header>
<div id="logo"></div>
<nav id="mainNav"></nav>
</header>
<div ...
7
votes
1answer
177 views
Semantically correct html5 markup
I'm writing the markup for Corpora - A Business Theme:
And started from the header section:
Here is my markup for it:
<header>
<div class="topHeaderPart">
<a href="#" ...
-1
votes
1answer
62 views
Trouble with jquery show and hide [closed]
I'm having a ton of trouble trying to get simple jquery functionality to work. All I want is to be able to click on a menu button and have a menu pop up and click outside of it to close it. I think ...
1
vote
2answers
171 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
408 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
308 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. ...
0
votes
2answers
54 views
HTML5 TAG using a .main class
since in my website I have a lot of <HEADER>, <FOOTER> AND <SECTION> do you think is appropriate if i use a .main class for the main HEADER, main FOOTER AND main SECTION?
In the CSS ...
2
votes
1answer
41 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
3answers
132 views
HTML5 code review
I have made this HTML5 structure for a new website i am working on. I'd like to know if there is a more elegant approach to do it.
Here is the Wireframe: http://i45.tinypic.com/2qiclci.jpg
1) Is the ...
4
votes
1answer
97 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
224 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
1k 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 ...
0
votes
1answer
87 views
Sectioning element choice for main content in HTML5 Bones
The new HTML5 Bones template uses the following example for the main content (I removed some parts (like ARIA, comments, aside, …) not relevant for this question):
<!-- The <section> element ...
-2
votes
2answers
97 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
109 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
143 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 ...
2
votes
1answer
69 views
Markup “YYYY-MM-DD” as input hint
I want to give users help in which format they have to enter a date. The label content is:
Date (YYYY-MM-DD)
I used the following markup:
<label>Date (<kbd><abbr ...
6
votes
1answer
180 views
Best way to construct a semantic html table
I have to do a table like this one:
+-------+-------+-------+-------+-------+-------+
| th 1 | th 2 | th 3 | th 4 |
+-------+-------+-------+-------+-------+-------+
| | ...
5
votes
2answers
155 views
Review for CSS layout code
I want to get my first CSS layout reviewed.
First of all, the related HTML code is as follows -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
...
-1
votes
1answer
63 views
Optimizations Help [closed]
How can we improve our Yslow performance grade C to A or B.
Looking for some helpful tips on improving the code on our website at www.wirenine.com - any tips to help improve page load times would be ...
1
vote
1answer
160 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
132 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
195 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
2answers
150 views
Is my code,design and practices is correct
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login and Registration</title>
<link rel="stylesheet" href="reset.css" ...
1
vote
0answers
63 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 ...
1
vote
0answers
37 views
CSS3 animations
I have the following code, which acts like a turntable and plays Sgt. Pepper when you load the page. This works only in Safari (I suppose I can delete the FF parts then), so I'm wondering how I can ...
2
votes
0answers
122 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
135 views
How to improve this JavaScript implementation of a TODO manager?
I was asked to create a TODO manager using JavaScript and CSS.
I did not get a good review on the code nor specific comments on how to improve it.
My implementation:
<html>
<head>
...
3
votes
1answer
133 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
344 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 ...
2
votes
1answer
3k views
Dynamically adding rows to an accessible HTML form
Given the following HTML form (fragment):
<fieldset id="timesheet-rows">
<legend>Add Entries</legend>
<div id="timesheetrow-0" class="timesheet-row">
<label ...