jQuery Slider plugin (Safari style)

jQuery Slider is easy to use and multifunctional jQuery plugin. Below you can find demos and documentation.

If you have any suggestions, comments or just found a bug – please do not hesitate to write.

Download sources&examples (54Kb)

jQuery Slider update

Slider
in string
{
  from: 5,
  to: 50,
  step: 2.5,
  round: 1,
  dimension: ' €'
}

{
  from: 5000,
  to: 150000,
  heterogeneity: ['50/50000'],
  step: 1000,
  dimension: ' $'
}

{
  from: 0,
  to: 500,
  heterogeneity: ['50/100', '75/250'],
  scale: [0, '|', 50, '|' , '100', '|', 250, '|', 500],
  limits: false,
  step: 1,
  dimension: '&nbsp;m<small>2</small>'
}

{
  from: 1,
  to: 30,
  heterogeneity: ['50/5', '75/15'],
  scale: [1, '|', 3, '|', '5', '|', 15, '|', 30],
  limits: false,
  step: 1,
  dimension: '',
  skin: "blue"
}

{
  from: 480,
  to: 1020,
  step: 15,
  dimension: '',
  scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'],
  limits: false,
  calculate: function( value ){
    var hours = Math.floor( value / 60 );
    var mins = ( value - hours*60 );
    return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins );
  }
}



Documentation

  • from — [number] left limit
  • to — [number] right limit
  • step — [number] step of pointer
  • round — [number] how many numbers after comma
  • heterogeneity — [array] (percentage of place)/(value of place)
  • dimension — [string] show this after number
  • limits — [boolean] show or not limits
  • scale — [array] labels under slider, ‘|’ — show just line
  • skin — [string] if you define new skin, just write here his name, in sources defined blue skin for example
  • calculate — [function(value)] function to calculate final numbers, for example time.
  • onstatechange — [function(value)] function fires while slider change state.
  • callback — [function(value)] function fires on “mouseup” event.
  • new features

Do not forget to set absolute or true relative path for png in jslider.ie6.css and jslider.ie6.[skin].css

146 thoughts on “jQuery Slider plugin (Safari style)

  1. Хороший плагин. Но сильно не хватает возможности смены позиции бегунка при клике на шкале. Сможете реализовать?

  2. Hello,

    It is a very good jQuery slider plugin, thank you very much!

    The only one feature I missed is a possibility to change slider position by clicking on scale.. Hope this will be available in next versions.

    Wishes,
    Eugene

  3. Pingback: 5 Fresh and Useful jQuery Plugins Were Born in November 2009 | AEXT.NET

  4. This is really cool. The only thing I’d suggest is that you consider using type=range, rather than your non-standard type=slider. That way–you’d have a cross-browser html5 range input.

    Excellent work.

  5. Pingback: jQuery Slider plugin (Safari style) « Design it. Develop it. Use it. « Netcrema – creme de la social news via digg + delicious + stumpleupon + reddit

  6. Pingback: jQuery Slider plugin (Safari style) « Design it. Develop it. Use it. : Popular Links : eConsultant

  7. Pingback: Easy to Use Safari Style jQuery Slider Plugin | Programming Blog

  8. Pingback: Online Business Management Software and Services » Blog Archive » Easy to Use Safari Style jQuery Slider Plugin

  9. Pingback: jQuery Slider plugin (Safari style)

  10. Pingback: Twitted by gominthink

  11. Pingback: AMB Album » Easy to Use Safari Style jQuery Slider Plugin

  12. Feels very robust, click and leave impartial from cursor position and no trouble to drag the different thumbs. I like the merge of the tooltip and the hiding of the labels very much, too.

    Good work, keep it on.

  13. An idea, maybe its already possible, can you handle time selections with this? Example showing a user 8:00 AM to 5:00 PM and allowing them to select start/end times for a particular event.

  14. Pingback: Slider Plugin (Safari Style)

  15. Pingback: Twitted by damonky

  16. thank you very much for this jQuery Slider plugin. It’s a very precious plug in even without changing the slider position just by clicking on scale…great job!

  17. Pingback: jQuery Slider plugin : Glissieres du style Safari | Anis Berejeb

  18. i need a slider for 1day, 1week and 30 days.
    can i achieve it using this plugin? please advise.

  19. Pingback: Web 2.0 Инструмент Safari Style jQuery Слайдер Плъгин | Web 2.0 Blog

  20. Pingback: Easy to Use Safari Style jQuery Slider Plugin | LightBlogs

  21. @Jatin I think you can use it, I don’t see any problems with that

    @gf @Mauzzam I’ve updated slider, now there two new functions, callback and onstatechange. Thank you for your replies.

  22. Egor,

    i am able to get 1 to 30 days now. How to get selected value? how to use onstatechange event?

  23. @Jatin .slider{ …, onstatechange: function( value ){ /*actions*/ }, … }
    if you just want to get final state — better to use callback event, it is the same usage like onstatechange

  24. like this?

    jQuery(“#SliderSingle”).slider({
    from: 1,
    to: 30,
    step: 1,
    round: 1,
    scale: [1, '|', 8, '|', '15', '|', 23, '|', 30],
    limits: false,
    dimension: ‘  day’,
    skin: “blue”,
    onstatechange: function(value) {
    alert(value)
    }
    });

  25. @Jatin yes, however, I think you don’t need round param here… because with your “round: 1″ you will see like “23,0 day”, this value set how much symbols after comma, default round is zero.

  26. Pingback: Safari style jQuery Slider | Ajaxmint - Endless Ajax samples on jQuery, MooTools, ExtJS, Dojo, Prototype and PHP

  27. Aha, after a while of scratching my head, I figured out what “heterogeneity” is:

    The heterogeneity value defines a series of points along the slider and the output value of the slider at those points, allowing you to tinker with how the output of the slider changes as you move the knob. The “percentage” is how far along the slider the point is — the X value. The “value of place” is the Y value at that X. Between the points, the output is linear with the input, but if you add enough points, you can make the output approximate a curve.

    I wrote this “calculate” function before I figured heterogeneity out. It’s a little smoother if you’re just trying to do a graduated scale, but it’s hard-coded for 0-3000 with a 5-point step, and it requires more computation in the user’s browser:

    calculate: function(value)
    {
    // This is a little bit “artistic.” Using an exponential to make the low
    // end move more slowly and the high end move more quickly, so it’s
    // easy to select $5, $10, $15, $25, but the scale can still go up to
    // $3000. The *600 followed by ceil() followed by the *5 provides
    // rounding to the nearest $5.
    // Caveats: We boost value to speed up low end (and the same boost
    // overall to prevent values beyond 100%)
    var lowendbooster = 600;
    return Math.ceil(
    Math.pow( ( value + ( value == 0 ? 0 : lowendbooster ) )
    / ( 3000 + lowendbooster ),
    5 )
    * 600
    ) * 5;
    }

  28. Pingback: Easy to Use Safari Style jQuery Slider Plugin | trackteq.com

  29. Is it possible to split the two range values in to seperate boxes when js is disabled?
    Not a huge problem but would be easier for people to understand how to input values if they have js disabled.

  30. @ Siju As you can see in sources — you should write you initial states in input’s value attribute, for example <input … value=”10″ … /> (one pointer slider) or <input … value=”10;20″ … /> (two pointers slider)

  31. Hi,

    Very good piece of code. But is there a way to dynamically (i.e. by ajax call) change value of settings ?
    I would like to be able to change the “to” value, depending on some other element.
    I tried to redeclare my jQuery(‘#myelement).slider({to: newvalue});
    but it draws another slider… any help ?

  32. @Guillaume Sorry, but there are no way now to do it, but I will try to add this as soon as possible. So keep looking for updates here.

    @Bethrezen It would be great :)

  33. Pingback: bulldoggie studio » Easy to Use Safari Style jQuery Slider Plugin

  34. Pingback: JQuery Plugins Diciembre 2009 | José Pinilla

  35. Great plugin!!! :D Just one little question, is there anyway possible to change the offset of the cursor values? I would like them to be right over the bar, and not over the cursor…. any ideas?

  36. how could i make it static ? i need it to unable the possibility to change the slider position in some of cases, any ideas ? thx !

  37. @JuanPablo Its possible to cahnge by jslider.css, string 21, margin-left value have to be 0. but its a bit strange result :)

    @kikos the faster way I see its put some semi-transparent or full transparent block right over slider. there are no another ways now.

  38. Hi Egor

    Thanks for this great work!
    I’m trying to get (“#Slider1″).val() to calculate things live on the page but it returns an empty string when the pages load, whereas once the slider has been clicked, it returns the correct value from the hidden tag…

    (I use jquery 1.2.6, the framework uses it, I cannot use 1.3.2 for now, don’t know if this can be the problem)

  39. i second Guillaume’s request.
    i will use a work around until then.

    Brilliant plugin by the way. I will be using it in my next project.

    thank you for your contribution.

  40. This worked for me when wanting to change options dynamically.

    first remove it.
    $(“span.jslider”).remove();

    Then re-Load it.
    $(“#Slider1″).slider(options);

    This will fulfill Guillaume’s request until something better comes along.

  41. I’m busting my head to figure out how to get the callback to identify which slider on the page fired it without having to create a different callback for every slider.

    Usually you get a reference to the object that fired the event.
    example: this.id
    But I’m not seeing any such reference here.

    Am I wrong?

  42. @jeff You could simply inspect slider object by firebug in your callback function: console.dir( this ); to find that this.inputNode — reference to jquery object of you input and catch id like this.inputNode.attr(‘id’);

  43. @egor
    I actually found this on my own by pouring through the source code.
    But I wish I had seen this earlier as I spent a couple hours trying to figure this out.

    Right now, this does everything I need it to do. The customer is very pleased.
    I am thrilled.

    Thanks much for your contribution. You have an excellent plugin here.

  44. Hi.

    First I’d like to say that this slider-function is superb.

    But still theres is a function I miss:
    $(#SingelSlider).slider(‘MoveTo’, 30);

    Is there a function to update the slider outside the slider?
    By that I mean; is there a function to call to update the slider and move the knob?

    Thanks, K

  45. Really nice look and purpose, i’m going to use it, for sure.
    But i’m still a beginner with jquery. Is there a way catch the initial value, just after initialization, before the user interact with the plug-in ?

    The purpose is to get an ajax builded slider and being able to figure it’s value out even if the user submits it without interacting.
    Perhaps an afterinit : function () {} ?

  46. Just noticed a little bug : Increase the right cursor’s value up to its maximum and release it. Then, incrase the right cursor to the same value of the other (both on maximum) and release it too…
    Now, try to change the value of any, you can’t anymore.

    I see two work around :
    - change the z-order, puting above the cursor which is on the wrong side (i mean the left above when it’s on the right side)
    - A more pleasant beavour would be that, when one cursor reach the other one, it pushes the other further and, when they reach a side, they can’t take the same value.

  47. amazing plugin :D
    I’m using it on a WordPress theme I’m working on, within theme settings (to visually change page column sizes).

    there’s just a small glitch that makes the scale inaccurate with certain scale values, like a 960 grid system in my case.

    the fix is to replace var prc = Math.round((((100/(s.length-1)))*10)/10);
    with var prc = (((100/(s.length-1)))*10)/10;
    and on the line below, (i*prc) with Math.round(i*prc)

    thanks!

  48. Pingback: 25 Amazing and Fresh jQuery Plugins - Speckyboy Design Magazine

  49. Pingback: 25 Amazing and Fresh jQuery Plugins · rogdykker

  50. I eaw one very impressive jQuery slider with many JS’s in it that I can’t and don’t now how to brake it. It is very, but very important for me to make one – JUST ONE -like that. Is there anyone nice, polite and knowledgeable to help me with it. i can even pay few bucks mfor help. But seriously people – very pretty and I really need it. Thanks

  51. Pingback: 25 Amazing and Fresh jQuery Plugins | Son Of Byte - Web Design & Development

  52. Pingback: 25 Amazing and Fresh jQuery Plugins - Programming Blog

  53. Pingback: 25 jQuery Slider Plugins | Toronto Web Design Firm | Spacevibes Blog

  54. Minor Bug!!!!

    I have really much impressed from this slider its really fantastic.
    But there is a minor bug in it.

    “When we set the both slider on the extreme right side its difficult to take them back.”

    thanks 4 accepting my request

  55. Could anyone help me with my problem? I have three sliders which are interrelated. When I adjust one slider higher, the other two sliders should adjust downward. I understand how to make the calculation using onstatechange, but how do I reference an existing slider and update the position of the pointer?

  56. Pingback: B3Graphics » Blog Archive » 25 Incredible jQuery Slider Tutorials and Plugins25 Incredible jQuery Slider Tutorials and Plugins

  57. Pingback: 40 Useful jQuery Techniques and Plugins - Smashing Magazine

  58. Pingback: 40 Useful jQuery Techniques and Plugins | Web Design Cool

  59. Pingback: 40 Useful jQuery Techniques and Plugins « all about designs

  60. Pingback: Wordpress Blog Services - 40 Useful jQuery Techniques and Plugins

  61. Pingback: 40个有用的jQuery插件 | Web启点

  62. Pingback: 40 Useful jQuery Techniques and Plugins - Programming Blog

  63. Pingback: 40 Useful jQuery Techniques and Plugins | Easybranches.com™

  64. Pingback: 40 Useful jQuery Techniques and Plugins » Shai Perednik.com

  65. Pingback: TG Designer » 40 Useful jQuery Techniques and Plugins

  66. Pingback: ArticleSave :: Uncategorized :: 40 Useful jQuery Techniques and Plugins

  67. Pingback: jQuery滑动条(滑块)插件 | Web启点

  68. Pingback: 40 Useful jQuery Techniques and Plugins « qeqnes | Designing. jQuery, Ajax, PHP, MySQL and Templates

  69. Pingback: 40 Useful jQuery Techniques and Plugins | Webreweries.com | Tips | Photoshop | Java | Illustrator | Dreamweaver | After Effects | Graphics | Animation | Design

  70. Pingback:   40 Useful jQuery Techniques and Plugins by webdunyam.net

  71. Pingback: 40 Useful jQuery Techniques and Plugins | STMGZN

  72. Pingback: 40 Useful jQuery Techniques and Plugins « Dheerajir's Blog

  73. Pingback: 12 More Creative & Usefull jQuery Plugins « The Creative Project

  74. Pingback: 12 More Creative & Useful jQuery Plugins « The Creative Project

  75. Pingback: Furkan Tunalı v4 beta // 40 Useful jQuery Techniques and Plugins /

  76. Pingback: 40 Useful jQuery Techniques and Plugins | i know idea

  77. Pingback: 40 Useful jQuery Techniques and Plugins via @smashingmag « webbuzz

  78. Pingback: 40 Useful jQuery Techniques and Plugins via @smashingmag | webbuzz

  79. Pingback: 40 Useful jQuery Techniques and Plugins

  80. Pingback: 40 Useful jQuery Techniques and Plugins | SKZYİZ

  81. Pingback: 40 Useful jQuery Techniques and Plugins | SKZYİZ

  82. Pingback: 40 Useful jQuery Techniques and Plugins | Communication et marketing

  83. Pingback: 50 Fundamental jQuery Controls and Rich UI Components - Speckyboy Design Magazine

  84. Pingback: 50 Fundamental jQuery Controls, Components and Plugins · rogdykker

  85. Pingback: ” 40个有用的jQuery插件 – HTML5,CSS3,WEB前端资讯站

  86. Pingback: 50 Fundamental jQuery Controls, Components and Plugins - Programming Blog

  87. Pingback: Feed-Syndicate » Blog Archive » 50 Fundamental jQuery Controls, Components and Plugins

  88. Pingback: 50 Fundamental jQuery Controls, Components and Plugins | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more!

  89. Pingback: 50 Fundamental jQuery Controls, Components and Plugins « lcs

  90. Pingback: 50 Fundamental jQuery Controls and Rich UI Components - Programming Blog

  91. Pingback: 50 Fundamental jQuery Controls, Components and Plugins | Forum on China Wholesale Lots

  92. Pingback: jQuery Slider Plugin | 2Novatos

  93. Pingback: 40 Useful jQuery Techniques and Plugins « R@j@. R.K

  94. Pingback: If you want to get along, Go along. » Blog Archive » 50 Fundamental jQuery Controls, Components and Plugins

  95. Pingback: 50 Fundamental jQuery Controls, Components and Plugins

  96. Pingback: Fundamental jQuery Controls, Components and Plugins « Ulancer

  97. Pingback: 50 Fundamental jQuery Controls, Components and Plugins « Son of Byte & Web Design & Development

  98. Pingback: 40 Useful jQuery Techniques and Plugins « SaiSatheesh

  99. Pingback: 40 Useful jQuery Techniques and Plugins | Retail Marketing Strategy

  100. Pingback: 25 Incredible jQuery Slider Tutorials and Plugins | Web Design Blog | Resources for Web designers and Graphic Designers

  101. Pingback: 25 Incredible jQuery Slider Tutorials and Plugins « Chilesabe

  102. Pingback: 21个jQuery滑动门效果插件 | 我爱互联网-woiweb|专注互联网设计与开发

  103. Pingback: 50 Fundamental jQuery Controls, Components and Plugins | Webmaster 9

  104. Pingback: 40 Useful jQuery Techniques and Plugins | Best Web Magazine

  105. Pingback: 40 Useful jQuery Techniques and Plugins | Geek is a Lift-Style.

  106. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins - Noupe Design Blog

  107. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins | Programming Blog

  108. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins « FED视野

  109. Pingback: Wordpress Blog Services - 50 Useful JavaScript and jQuery Techniques and Plugins

  110. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins » Shai Perednik.com

  111. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins » Shai Perednik.com

  112. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins html5 css3 design depot news News Design

  113. Pingback: JQuery 2010 useful articles html5 css3 design depot news News Design

  114. Pingback: 21个jQuery滑动门效果插件 | 那一片蔚蓝的天空

  115. Pingback: 彼岸(Into the wild) » Blog Archive » 50 Useful JavaScript and jQuery Techniques and Plugins

  116. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins » abdie.web.id

  117. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins | LionWebMedia.com

  118. Pingback: 十年电商网_中国最大电子商务信息网 » 21个jQuery滑动门效果插件

  119. Pingback: 50 Useful JavaScript and jQuery Techniques and Plugins | Tutorials Socialmoto

  120. Pingback: 40 Useful jQuery Techniques and Plugins « Propaganda Digital Indonesia

  121. Pingback: Fundamental jQuery Controls and Rich UI | cutlee.com

  122. Pingback: Awesome jQuery Plugins And Techniques To Create Visually Excellent Websites « WORLD OF RADZAD

  123. Pingback: OmniDownloads | Awesome jQuery Plugins And Techniques To Create Visually Excellent Websites

  124. Pingback: 25 Incredible jQuery Slider Tutorials and Plugins « Keyurkr's Blog

  125. Pingback: Amazing Jquery Plugin for Websites : scribbledplush

  126. Pingback: 40种有用的jQuery技巧及插件|Narco

  127. Pingback: UI Slider Customization - iPhone Dev SDK Forum

  128. Pingback: Bilcyber Portal » 40 Useful jQuery Techniques and Plugins