Solved

adding a bunch of css

Posted on 2011-09-16
4
262 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:knowlton
  • 2
4 Comments
 
LVL 82

Accepted Solution

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

0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 100 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:knowlton
ID: 36563100
thx
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now