0

i want to design a dynamic modal-dialog for my component. i get width and height from input and set these to my content div. and may be i have several modal-dialog in one page. how can make it with java script and jQuery ?

1

2 Answers 2

2

You can try to use

http://api.jquery.com/css/

as in $( "#mydiv" ).css( "color", "green" )

You can use it with any jquery selector/id, not just class.

$( "#mydiv [name='changeme']" ).css( "color", "green" ); 
Sign up to request clarification or add additional context in comments.

6 Comments

thank you but i have a problem when i use .css() ,this method change my classوWhereas i want use this class for another div.
You can use it with any jquery selector/id, not just class.
NO ,i think you do'nt got my Purpose.this method change my content class but i want use this class for other similar div.and my div was changed.
Please explain your purpose then.
i have a class in my css file.i must change width and height of this class just for one time ,and i want to reset my class for Reuse.
|
1

Use as follows :

$( "#mydiv" ).css( "width", $("#widthtextbox').val() );

And

$( "#mydiv" ).css( "height", $("#heighttextbox').val() );

Where widthtextbox and heighttextbox and the ids of the textbox from where you are trying to use values, and mydiv is the div to add css to.

hope this helps you.

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.