Results tagged DOM

jQuery-logo.pngSomeone asked me recently "How can make something on a page show and hide with a mouseover event using jQuery?". I  looked at the jQuery documentation and quickly came up with this example and code. It turned out to be exactly what they were looking for.

I looked at a few of the events and effects like the mouseover() and mouseout() functions but that seemed to be to much for something this simple. This was basically the same thing as using the css(hover) property, So there is was, listed right under the jQuery events docs, hover().

Try my working demo. Here.

I started with two items that I could hover over and out on to make sure I got that part working right. Here's the code I started with:

    jQuery ready function and hover event:

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota
What is the DOM? The DOM is an object oriented view of HTML documents. HUH?

An HTML page is a document, within that page exists tags such as:

<body></body>, <h2></h2>, <div></div>, <span></span>

These html tags could be referred to in a few ways, such as, tags, elements, or even objects. When working with or manipulating the dom you will mostly refer to the items as elements, like when using getElementById(). But when standing back and viewing you document in greater detail these elements represent more of a life as an object. If your familiar with OOP programming you will know and an object is related to another object as are it's attributes and so on. We refer to this as a hierarchy.

In an HTML document there are elements that are on top of other elements that cause the characteristics of that element. For instance:
BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota
| | Comments (0) | TrackBacks (0)
BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota
There are Object properties and Standard properties for your DOM Elements. The properties listed below are your Standard Element properties.

className: Gets/sets the class name of your Element.

    Syntax: object.className = className

    Example:
   
	<body id="myid" class="mystyle">
	<script type="text/javascript">
x=document.getElementsByTagName('body')[0];
document.write("Body CSS class: " + x.className);
document.write("<br />");
document.write("An alternate way: ");
document.write(document.getElementById('myid').className);
</script>

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota
| | Comments (0) | TrackBacks (0)
BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota


Chicago Blackhawks
Chicago Blackhawks
Stanley Cup
Stanley Cup
Pittsburgh Penguins
Pittsburgh Penguins
Boston Bruins
Boston Bruins
Fire & Flames
Fire & Flames








 


Categories

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, Acura, Honda, Acura Forerunner,bmw bmw bmw SUV, BMW, Mercedes, Toyota