HTML5 is the latest revision of the HTML standard, including many new syntactical features and several APIs that support drawing, video, audio, etc.
3
votes
0answers
14 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
22 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
19 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
81 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
53 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
40 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
65 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
99 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
64 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
132 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
199 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
51 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
55 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
198 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
77 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
60 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
118 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
99 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
99 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
87 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
84 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
64 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
92 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
384 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
215 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
66 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
480 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
660 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
359 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
57 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
44 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
148 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
252 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
98 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
99 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
126 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
149 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
77 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
236 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
160 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
66 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
163 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
137 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
207 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
152 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
66 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
124 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 ...