CSS Unit 6
CSS Unit 6
Menus,
Navigation and
Web Page
Protection
Contents
6.1. Status bar - build a static message , changing the
message using rollovers,
moving the message along the status bar
6.2. Banner - loading and displaying banner advertisements,
a linking banner
advertisements to url
6.3. Slide Show – creating a slide show
6.4. Menus - creating a pull-down menu, dynamically
changing a menu, validating menu selections, floating menu,
chain select menu, tab menu, popup menu, sliding menu,
highlighted menu, folding tree menu, context menu,
scrollable menu, side bar menu
6.5. Protecting Web Page - hiding your code, disabling the
right mouse button, concealing email address
6.6. Frameworks of JavaScript and its application
6.1 Status bar
■ Variety of tricks are used by developers to communicate
messages
to visitors of their web sites
■ When you move mouse cursor over an HTML link, the URL
appears
in the status bar.
6.1.1 Build a static message
■ JavaScript gives the ability to modify the status bar.
■ For example it can be useful
– to display information about a link, when the user
moves his mouse over it
– To display a small amount of information about the
page the user is on in the status bar.
■ To display messages in the status bar, you will need
to use window.status property.
6.1.1 Build a static message
■ The status property sets the text in the status bar at the
bottom of the browser, or returns the previously set text.
■ The defaultStatus property, specifies the default text
displayed in the
status bar.
■ Note: The status property does not work in the default
configuration of IE, Firefox, Chrome, Safari or Opera 15
and newer.
■
To allow it the user must set the
dom.disable_window_status_change
preference to false in the about:config screen. (or in
Firefox: "Tools -
Options - Content -Enable JavaScript / Advanced - Allow
scripts to change status bar text").
Example
<html>
<head>
<title>Show text message on status bar</title>
<script>
function showStatus() {
var win = window.open('', 'win', 'width=100, height=100');
win.status = 'Hello';
win.defaultStatus = "Hello World!"
win.document.write("Status Text: " + win.status);
win.document.write("<br>Default Status Text: " + win.defaultStatus);}
</script>
</head>
<body onload="showStatus()">
<h1>This is an example of Status bar</h1>
</body>
</html>
6.1.2 Changing the message
using rollovers
■ We can use rollovers to signal the
browser when a different message should
be displayed.
■ Typically positioned near the top of the web page, and its
purpose is
to get the visitor's attention by doing all sorts of clever things.
■ You cannot hide your HTML code and JavaScript from viewers but
you can place obstacles in it.
■ You can disable the right mouse button on your site so the visitor
can't access the View Source menu option on the context menu.
■ These are the programs that surf the Net looking for e-mail
addresses that are embedded into web pages, such as those
placed there by developers to enable visitors to contact them.
■ The bots then strip these e-mail addresses from the web page
and
store them for use in a spam attack.
6.5.3 Concealing email address
■ The solution to this common problem is to conceal your e-
mail address in the source code of your web page so that
bots can't find it but so that it still appears on the web page.