Questions tagged [jquery-calculation]

101 questions
1
vote
1 answer

jQuery Tip Calculator - Formulas with Variables Based on TextArea Inputs

I found a few threads that were helpful, but nothing answered my question directly, so here's the specific issue: To hone my limited jQuery skills I am creating a Split the Bill/Tip Calculator that calculates amounts on the click of a button based…
1
vote
2 answers

Calculate the average from 3 colors based on a percentage

How can I calculate the average of three colors based on a given percentage? For example we've green, yellow and red and want to get the average value: The simplest way to do this is to create an image like this one: And increase/decrease the…
yckart
  • 28,174
  • 7
  • 112
  • 121
1
vote
2 answers

jQuery - calculate average from span tags and output in a text field

I just started with jQuery and I'm having some troubles. I need to get a number between span tags, and output an average in an input field. Only the spans with a value different from 0 are valid , otherwise they should be ignored. Also the numbers…
djwd
  • 305
  • 2
  • 5
  • 15
1
vote
0 answers

jQuery - Unknown issue calculating average from sliders value

I got six jQuery UI sliders in a Wordpress metabox, I get they're values and output the average to a text input field (#pm_overall_score), this is the JS that handles this: var sum = 0 ; var nums = 0; $('.rwmb-slider').bind({ slidechange :…
djwd
  • 305
  • 2
  • 5
  • 15
1
vote
3 answers

jQuery mousemove direction, get correct distance

Howdey, i need to create a direction aware hovering effect, but stuck at the correct calculation. (Is it a calculation problem or rather a wrong markup?) Here's what I've done so far: The left and right arrows works as expected, but up and down…
yckart
  • 28,174
  • 7
  • 112
  • 121
1
vote
1 answer

jQuery mousemove (cursor "overview") wrong calculation

I'm trying to create a document/cursor "map-overview", however i stuck at the calculation. The pointer still exceeds the overview box. Here's what I've done so far: var box = $('#box'), pointer = box.find('i'); $(window).on('mousemove',…
yckart
  • 28,174
  • 7
  • 112
  • 121
1
vote
2 answers

Jquery calculation plugin for complex calculations

I've had a lot of help from a number of you over the past week or so with my first effort programming an application from the ground up. Thank you from the bottom of my code monkey heart! I need to add a points calculation function to my fantasy…
Cynthia
  • 4,945
  • 13
  • 39
  • 67
0
votes
1 answer

JQuery - Automatic Calculations

I'm having a period mental melt down here. For 2 days, I've been looking at numbers and trying to get this damn calculation to work, but now i can't get the result method to work. I'm having 1 textboxs, 2 checkboxs, 1 dropdown and a h1 where the…
Patrick R
  • 1,959
  • 3
  • 30
  • 57
0
votes
0 answers

how to compare a quantity field that can be integer or float using jquery

I have the following situation. I want to validate an input of total quantity and order quantity, but I need to compare integer numbers in float as I consider, I appreciate any help and suggestion. Thanks
0
votes
3 answers

Why this code is not working properly on jQuery

I do not know where is the problem on this code and how to solve it. I want to add form input field and also calculated on properly. Problem described below: when I click add row button this page refresh. That wise I can't cheek the delete…
0
votes
1 answer

Update Calculations When Table Row is Added / Removed

Iam trying to using jAutoCalc Plugin to make some calculations on numbers and it's ok and The calculations are done correctly. But when I tried to use jquery.repeater plugin to add rows to table , the New rows are not counted within the calculation…
0
votes
1 answer

jQuery selector that selects class name with only one number following that class name

so I have the following structure:
1,2
2,2
5,4
3,2
etc... I want a jQuery selector that will select only num1 and num2, numX where X…
Nikola
  • 14,218
  • 18
  • 94
  • 158
0
votes
1 answer

jQuery Calculations not working out

I'm using the jQuery Calculator plugin (http://www.pengoworks.com/workshop/jquery/calculation/calculation.plugin.htm) and have stumbled across a small problem when calculating the cost of cupcakes. I need £19 for 1-12 products, £37 for 13-24…
0
votes
1 answer

jQuery: Stop window height recalclulation once conditional statement returns false

I have a jQuery function which changes the size of columns if some conditions are met. The function starts working once the window has been resized. But it doesn's stop recalculations once the conditions return false. How it could be solved? Here is…
Kuzma
  • 472
  • 1
  • 10
  • 29
0
votes
1 answer

Javascript Driven Table Values

I'm working on a Product Detail page that allows users to choose the number of products to purchase. I currently have the quantity dial working properly, but I need to piggyback on such feature to update a table that displays the total purchase…