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
23 views
WebGL ( Three.js ) simple application ( only js without html/css )
I have done the source code for my lesson, which I shall publish later in web at my website, let's look at it:
<script src="three.min.js"></script>
<script>
var renderer, scene, ...
0
votes
1answer
15 views
Need help with Random Number Generator Game code [on hold]
I am trying to create a random number generator game that compares an input to a random number that is determined by the JS. I cannot get this code running for the life of me and I cannot see where ...
-2
votes
0answers
22 views
Interactive map using javascript [closed]
Im trying to learn HTML and javascript. But i cant find any information about how to create interactive map using javascript.
Ex. I take a map where is a part of my town and write some information ...
3
votes
2answers
81 views
Javascript Tic-tac-toe review: best practices, correctness, and any other improvements/suggestions
I just finished a little game of tic-tac-toe for a class I'm in, and I think it looks alright, but I'm pretty fresh, so I would like to know how I might be able to improve it, given the situation I'm ...
0
votes
0answers
27 views
Simple : Pasting plain text (without rich HTML)
I try to let users paste text without rich HTML
Function should be so simple, like using clipboardData or prompt if browser not support.
$('[contenteditable]').on('paste', function (e) {
...
1
vote
2answers
46 views
How can I add a delete function to this code that stores stuff in localStorage?
I'm adding names of blogs to localStorage. I use those to make links and get avatars.
Here's a fiddle that does the adds but I need a nice delete function for individual entries.
Here's part of ...
5
votes
1answer
151 views
First HTML5 game. - Snake!
so here's my first HTML5 game. It's a really simple snake. I've never made a game before and haven't had too much experience with JavaScript.
Html
<body>
<canvas id="snakePlatform" ...
3
votes
0answers
16 views
“Stack exchange page visits” alike implementation
StackExchange page views works like this: Link
The objective is to increment the page visits by one. User should not be able to do this by refreshing. Number of visits can be incremented only if ...
2
votes
0answers
34 views
adding a new class to html tag and writing it back with beautifulsoup
I am working on a HTML document to which I need to add certain classes to some elements. In following code I am adding class 'img-responsive'. Here is my code :
def add_img_class1(img_tag):
try:
...
3
votes
1answer
26 views
Optimizations for this user-account HTML structure?
I need a valid and semantic HTML structure for the user-account (user-panel) section of the overall layout of my web application.
What I saw in other web apps include:
User title (or email, or ...
2
votes
1answer
112 views
jQuery toggle sort order and save to variable
This is copied directly from Stackoverflow as I was suggested to post it here.
I have the below code, which does work fine but I find it quite big and had hoped there was a cleaner/smaller "toggle" ...
4
votes
2answers
62 views
Am I following the correct principles for HTML / CSS coding?
I've just started learning HTML and CSS. Currently I'm creating a test site to practice with.
I'm just after an early idea if the principles I'm using are correct.The below is an snipit from the main ...
1
vote
1answer
47 views
Simplifying an ajax script in my HTML
I'm using Twitter Bootstrap and I'm working on a page that has several tabs that all have carousels in them (each with a ton of images) I've managed to write an AJAX script that pulls the images from ...
2
votes
0answers
70 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 ...
4
votes
1answer
109 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
67 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
143 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
416 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
55 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 ...
3
votes
1answer
68 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
259 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
81 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
63 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
2answers
131 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
108 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
111 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
88 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
87 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
65 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
120 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
502 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
237 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
72 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 ...
2
votes
2answers
777 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
812 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
405 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
58 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
47 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
158 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
99 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
259 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
2k 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
102 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 ...
-3
votes
2answers
104 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
145 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
151 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
84 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
300 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
164 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" />
...
-2
votes
1answer
69 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 ...