0

I have a div that has a border of 10px. What I want to do is change the size of the border by moving the jQuery UI slider widget.

HTML

<h1>Choose Your Size!</h1>
<div id="map">
<div id="detail">
    <div id="slider"></div>
     <div class="dataPt"></div>
</div>
</div>

jsfiddle

http://jsfiddle.net/NWztP/1/

0

1 Answer 1

1

Never used this before, just looked at http://api.jqueryui.com/slider/#event-slide

$(function() {
    $( "#slider" ).slider({
        slide: function( event, ui ) {
            //console.log(ui.value);
            $('.dataPt').css({borderWidth: ui.value});
        }
    });
  });

Updated jsfiddle

To maintain a circle

$('.dataPt').css({borderWidth: ui.value, borderRadius: ui.value * 2});

http://jsfiddle.net/NWztP/3/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.