HTML and CSS Reference
In-Depth Information
Listing 6-44. Get and Set Element dimensions
// Get element height
var ElementHeight = $("#DivID").height();
// Set element height
$("#DivID").height(300);
// Get element width
var ElementWidth = $("#DivID").width();
// Set element width
$("#DivID").width(400);
Handling CSS Classes
CSS Classes can be created and removed using the addClass and removeClass jQuery functions (Listing 6-45).
Listing 6-45. Add and Remove CSS Classes
// Create a CSS class
$("#DivID").addClass("newclassname");
// Remove a CSS class
$("#DivID").removeClass("classname");
// Create a new class and remove the old one
$("#DivID").removeClass("classname").addClass("newclassname");
// Create and remove multiple classes
$("#DivID").removeClass("classname classname2").addClass("newclassname newclassname2");
Change CSS Properties
The CSS properties of markup elements can be manipulated by the css jQuery function (Listing 6-46).
Listing 6-46. Change the CSS Property for an Element
$("#DivID").css("border", "solid 1px #00f");
Silverlight
Silverlight is a freeware application framework created by Microsoft Corporation for developing rich Internet
applications [28]. The runtime environment for Silverlight is available as a web browser plug-in. Silverlight provides
many features similar to those of Adobe Flash, such as animations, drawing objects, reflection effects, glyphs,
and so on.
Silverlight uses the Extensible Application Markup Language (XAML) instead of Scalable Vector Graphics
(SVG). XAML is a declarative, XML-based user interface markup language developed by Microsoft and used
extensively in .NET.
 
Search WWH ::




Custom Search