Instead of using "in your face" skyscraper or double-wide banners, you can make a standard banner that expands to show more information. In this article, I provide you with easy code to create several different kinds of expanding banners.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact Advertise on Bucaro TecHelp Advertise Here RSS News Feeds News Feeds

HTML5 Solutions: Essential Techniques for HTML5 Developers

Essential Techniques for HTML5 Developers

HTML5 brings the biggest changes to HTML in years. Web designers now have new techniques, from displaying video and audio natively in HTML, to creating realtime graphics on a web page without a plugin.

This book provides a collection of solutions to all of the most common HTML5 problems. Every solution contains sample code that is production-ready and can be applied to any project.

Click Here

Easy Java Script Expanding Banner Code

The most common method for advertising on the Web is banners. But the standard banner may be too small to provide enough information. Instead of using "in your face" skyscraper or double-wide banners, you can make a standard banner that expands to show more information. In this article, I provide you with easy code to create several different kinds of expanding banners.

The code consists of four parts:

1. An html <span> element on your webpage
2. One or two optional graphics images
3. One or two Cascading Style Sheets (CSS) classes
4. One or two Java Script functions

Don't be scared off by the (CSS) classes or Java Script functions, I promise you, this is very easy to do. Lets do the most difficult example first. This first example does not use a graphic image for the banner, it relies entirely on CSS to create the banner.

The banner is defined as a <span> in the <body> section of your webpage, the html is shown below.

<span class="expandable" id="banner">Move mouse pointer over banner</span>

Note that the span has a class attribute and an id attribute defined. The text "Move mouse pointer over banner" is the text that will appear on your banner. Replace this text with your advertising message.

The code for the CSS class "expandable" is shown below. Paste this code in the <head> section of your webpage.

<style type="text/css">
.expandable
{
   position: absolute;
   left: 0;
   top: 0;
   width: 468;
   height: 60;
   border-style: solid;
   border-width: 4;
   border-color: blue;
   margin: 10px;
   padding: 5px;
   background-color: yellow;
   background-image: url("background.gif");
   color: red;
   font-family: Arial;
   font-weight: bold;
   font-size: 20pt;
   font-style: italic;
   z-index:2;
   visibility: visible;
}
</style>

The purpose of this article is give you some quick easy working code, not to bog you down with a long-winded explanation of CSS. So I will point out only a few important facts about the CSS code. The lines left: 0; top: 0; width: 468; and height: 60; define the location and size of the banner. Note that the standard banner size is 468 x 60 pixels.

The code defines a background-color property and a background-image property. Obviously it is not useful to define both of these properties together. Delete the line for the one you don't want to use.

Most of the other "property: value;" pairs defined in the class are self explanatory and you can experiment with them. Except for the color property, which actually applies to the text color.

RSS Feed RSS Feed



Web Design Sections

Eloquent JavaScript: A Modern Introduction to Programming

Eloquent JavaScript

Eloquent JavaScript Eloquent JavaScript goes beyond the cut-and-paste scripts of the recipe books and teaches you to write code that's elegant and effective. You'll start with the basics of programming, and learn to use variables, control structures, functions, and data structures. Then you'll dive into the real JavaScript artistry: higher-order functions, closures, and object-oriented programming.

Reader Anthony says, "This book is not your typical Javascript book. Others have a utilitarian approach. In stark contrast, Eloquent JavaScript does not merely provide you a checklist of things to learn but rather paints a panorama of the possibilities that programming provides. Javascript is merely the tool used to introduce these to the reader.

Click here for more information.


[Site User Agreement] [Advertise on This site] [Search This Site] [Contact Form]
Copyright©2001-2011 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268