jQuery UI Widgets Forums Getting Started Slider width

This topic contains 3 replies, has 2 voices, and was last updated by  svetoslav_borislavov 1 year, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Slider width Posts
  • Slider width #133736

    Aryan29
    Participant

    Hi Team, I want to know if there’s a way to make the slider width same as the width of container it is in.

    Slider width #133739

    Hi,

    Use the width property and set it to 100%
    Here is an example: https://jsfiddle.net/utzokar0/1/

    I hope this helps!

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team
    https://www.jqwidgets.com/

    Slider width #133740

    Aryan29
    Participant
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Slider</title>
        <link rel="stylesheet" href="./jqwidgets/jqwidgets/styles/jqx.base.css">
        <link rel="stylesheet" href="./jqwidgets/jqwidgets/styles/jqx.fluent.css"> 
        <script type="text/javascript" src="/jqwidgets/scripts/jquery-1.11.1.min.js"></script>   
        <script type="text/javascript" src="/jqwidgets/jqwidgets/jqxcore.js"></script>       
        <script type="text/javascript" src="/jqwidgets/jqwidgets/jqxbuttons.js"></script>
        <script type="text/javascript" src="/jqwidgets/jqwidgets/jqxscrollbar.js"></script>
        <script type="text/javascript" src="/jqwidgets/jqwidgets/jqxlistbox.js"></script>
        <script type="text/javascript" src="/jqwidgets/jqwidgets/jqxslider.js"></script>
    
    </head>
    <body>
        <div id="container" style="width: 100%; background-color:red;">
            <div id="slider"></div>
        </div>
        <script src="script/jqxSlider.js"></script>
    </body>
    </html>
    $(document).ready(function(){
        var containerWidth = $("#container").width();
        $("#slider").jqxSlider({theme:'fluent',height:6,width:containerWidth,});
        $("#slider").on('slide',function(event){
                var value= $("#slider").jqxSlider('value');
                console.log(value);
        })
    })

    I just want to know why there is a margin right and left of the slider. If you try my code you will se it.

    Slider width #133747

    Hi,

    There is a margin because of the buttons, see your demo here:
    https://jsfiddle.net/p36vghuo/

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.