Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript Slider - NOT IMAGE!

Featured Replies

Hi guys,

 

I'm looking for a slider (scrollbar type) that calculates profit.

 

I'm probably making this sound more complex than is it, basically imagine one slider (horizontal). Below it is some text, on the left hand side perhaps something called "Cost Price", on the right hand side "Profit". Then as you move the slider upwards it calculates the profit from the cost price depending on where the slider is.

 

For example. The cost price is £100, and the resell price is set, on the slider, to £110, the profit then auto updates to £10 profit. As you move the slider obviously it's dynamic.

 

I've been googling this for a couple of days now, the problem I've got is that google returns loads of Javascript image sliders and that's not what I want, I've tried "javascript calculation slider" but I just end up with Javascript calculators!

 

Any pointers or help here would be great!!

 

Cheers.

i think you can use something like this http://jqueryui.com/demos/slider/#steps but you have to do all the sums yourself i think. Use the examples on the right hand side for the calculations

 

Never used it but seen this slider used in the same way you want on other websites

  • Author

i think you can use something like this http://jqueryui.com/demos/slider/#steps but you have to do all the sums yourself i think. Use the examples on the right hand side for the calculations

 

Never used it but seen this slider used in the same way you want on other websites

 

Thanks, that's kinda the thing I'm after but I have very little knowledge of Javascript, I'm more of a CSS/HTML kinda guy.

 

Can anyone explain how I'd work out the calculation?

 

An example is:

 

Cost Price: £100 <--- SLIDER HERE ---> Profit: £?? (slider value + cost price)

 

Cheers.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.