0

The context for this: jsFiddle link

I'm trying to make it so the changeWidth function's second parameter can be a percentage value (like in css: something: 50%;). If you follow the link I provided it should be fairly obvious why I'm trying to do this. I thought maybe the parameter passed is just a number (e.g. 75), but then in the method itself it converts it to a % for use in the animate(..) invocation... But I don't know how to do this either.

Any ideas? :)

EDIT: I managed it! Don't worry! (If interested, see this)!

0

3 Answers 3

1

just like this:

changeWidth($("#testbar"), '50%');

it does work for me.

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

1 Comment

I'll give you the selected answer as you were first, but I actually managed to work it out before you responded. Thanks anyway though! :D
0

You can pass the width as a string

$(function(){
    changeWidth($("#testbar"), '70%');
});

Comments

0

http://jsfiddle.net/ruFrp/7/

$(function(){
    changeWidth($("#testbar"), '50%');
});

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.