Pages

Saturday, 19 April 2014

Dynamic styles

Dynamic styles are a key feature of DHTML. By using CSS, you can quickly change the appearance and formatting of elements in a document without adding or removing elements. This helps keep your documents small and the scripts that manipulate the document fast.
The object model provides programmatic access to styles. This means you can change inline styles on individual elements and change style rules using simple JavaScript programming.
Inline styles are CSS style assignments that have been applied to an element using the style attribute. You can examine and set these styles by retrieving the style object for an individual element. For example, to highlight the text in a heading when the user moves the mouse pointer over it, you can use the style object to enlarge the font and change its color, as shown in the following simple example.

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Dynamic Styles</title>
        <style>
            ul {display:none;}
        </style>
    </head>
 
    <body>
        <h1>Welcome to Dynamic HTML</h1>
 
        <p><a href="#">Dynamic styles are a key feature of DHTML.</a></p>
 
        <ul>
            <li>Change the color, size, and typeface of text</li>
            <li>Show and hide text</li>
            <li>And much, much more</li>
        </ul>
 
        <p>We've only just begun!</p>
 
        <script>
            showMe = function () {
                document.getElementsByTagName("h1")[0].style.color = "#990000";
                document.getElementsByTagName("ul")[0].style.display = "block";
            };
 
            document.getElementsByTagName("a")[0].onclick = function (e) {
                e.preventDefault();
                showMe();
            };
        </script>
    </body>
</html>

No comments:

Post a Comment

 

Animation news

Pixion is a state of the art post production facility that offers 360 degree creative and technological services with the cutting edge expertise to cinematic masterpieces. Pixion has been always enthusiastic about new projects with creative ideas and Bhoothnath Returns is one amongst their masterpieces.
Pixion, who is renowned for their work in movies like Grand Masti, Taalash, Son of Sardar, Barfi!, Chasme Badoor,Don 2 and ABCD recently delivered VFX for Bhoothnath Returns. It has delivered stunning VFX shots for this film.

Testimonials

“We were looking for a logo with a touch of modernism. Mitesh sata our needs and produced a stunning design. When feedback was needed, new versions of the logo or any modifications were made very quickly. We really appreciated Mitesh flexibility and efficiency. It’s great to work with someone so open-minded and responsive. Thank you!”


About

Mr Mitesh sata(CEO)
WEB : www.pixelcreation.in
Email : pixellcreation@gmail.com