Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
08-03-2014, 06:04 AM #1
- Join Date
- Dec 2013
- Thanked 0 Times in 0 Posts
Can't get a script to work, please help if you can
My URL: FunMed | Fun And Innovative Medical solutions | Makers of The FunHaler Inhaler Case
I am trying to do this:
Edit fiddle - JSFiddle
I have the bar pretty much in place, and the styling correct, but I can not get it to function (to fill as you scroll down the page) like it does in the example.
var h = $(document).height();
var s = $(window).scrollTop();
var w = $(window).height();
var t = (s / h) * w;
var p = Math.ceil((s + t) / h * 100) + 1;
$('#progress-bar').width(p + '%');
Can anyone give me a hand with this? I am close, but not quite there. Thanks!