I need some help learning CSS+JS For CSS I'm trying to style a button into a block image and for JS I need some help with creating a loading bar.
Sorry my skills are bad
But I'm ok with HTML,CSS,JS
Last edited by Devloper123 (2013-04-06 15:20:14)
Offline
I can't post code since I'm on my phone, but for the button use a background image.
For the progress bar, use background colors and sizes of two different HTML elements.
Offline
Can you post code using your computer/laptop?
Offline
Offline
nXIII wrote:
Use <progress> for the loading bar.
Let me just clarify that this is an HTML5 element that wasn't yet supported in HTML 4 and XHTML 1.
Offline
nXIII wrote:
Use <progress> for the loading bar.
You can But i'm trying to make a player using JS.And anyway this html5 page is Designed for 3DS and iOS
Offline
LS97 wrote:
nXIII wrote:
Use <progress> for the loading bar.
Let me just clarify that this is an HTML5 element that wasn't yet supported in HTML 4 and XHTML 1.
It's didn't exist in HTML4, so of course it wasn't supported….
If it's designed for iOS, you'll have to do something else, though.
Offline
Devloper123 wrote:
Can you post code using your computer/laptop?
Ok, back on my laptop.
Button
CSS
#button { background-image: url('images/button.png'); }
Obviously you'll need to change that to your liking.
HTML
<button id="button">MyTextHere</button>
You can use any type of button you like, just set the id to button.
Progress Bar
(I'm going to do this in HTML4)
JS
function setProgressBar(percentage) { percentage = percentage/100; var progress = document.getElementById('progress'); var progressBar = document.getElementById('progressBar'); progress.style.width = (percentage*parseInt(progressBar.style.width))+"px"; }
CSS
#progress { width: 0px; height: 14px; background-color: blue; } #progressBar { width: 100px; height: 16px; background-color: white; border-style: solid; border-width: 1px; border-color: black; }
Also change to your liking.
HTML
<div id="progressBar"><span id="progress" /></div>
I might have gotten my syntax a little messed up since I haven't tested it, but try it.
Offline
thanks ill give credit
Offline