?
Solved

adding a bunch of css

Posted on 2011-09-16
4
Medium Priority
?
271 Views
Last Modified: 2012-05-12
  $('div[class*="webmesswrapper"]').css("height", "400px").css("width", "300px");

Is there a better way to do this besides chaining a bunch of css calls together?
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 1600 total points
ID: 36550992
pass an object:
$('div[class*="webmesswrapper"]').css( {height:"400px",width:"300px"} );

0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 400 total points
ID: 36550996
yes of course :

 $('div[class*="webmesswrapper"]').css( {   "height": "400px",  "width": "300px"   } );
0
 
LVL 82

Expert Comment

by:hielo
ID: 36551019
is you are updating hyphenated properties, be sure to use quotes around the property name - ex:
wrong:
{height:"400px",width:"300px", margin-top:"3px"}
correct:
{height:"400px",width:"300px", "margin-top":"3px"}
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 36563100
thx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question