progressbar Javascript need not change for content
The content of the amounts for the fundraiser can be kept in the HTML rather than the progress bar Javscript code. I suspect at some point I should keep this data in the Django database and extract it from there as dynamic content.
This commit is contained in:
		
							parent
							
								
									bbbface83a
								
							
						
					
					
						commit
						60d0a06e25
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		|  | @ -5,7 +5,12 @@ | |||
| */ | ||||
| 
 | ||||
| $(document).ready(function() { | ||||
|     $("#progressbar").progressbar({ value: (0.00 / 5000.00) * 100 }); | ||||
|     var goal  = $('span#fundraiser-goal').text(); | ||||
|     var soFar = $('span#fundraiser-so-far').text(); | ||||
|     var noCommaGoal = goal.replace(/,/g, ""); | ||||
|     var noCommaSoFar = soFar.replace(/,/g, ""); | ||||
| 
 | ||||
|     $("#progressbar").progressbar({ value: (parseFloat(noCommaSoFar) / parseFloat(noCommaGoal)) * 100 }); | ||||
| 
 | ||||
|     $('.toggle-content').hide(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| 
 | ||||
| <div id="donate-box" class="toggle-unit"><h1 class="toggle-content">Support | ||||
|     Now!</h1></div> | ||||
| $240 of the $5,000 match goal met.<br/> | ||||
| $<span id="fundraiser-so-far">240</span> of the $<span id="fundraiser-goal">5,000</span> match goal met.<br/> | ||||
| <div id="progressbar" style="height:20px;"><span style="float:right; align:center; margin-right:40%">0.05%</span></div> | ||||
| 
 | ||||
| <h3>Help Us Reach Our Match Goal:</h3> | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn