473,725 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scrollable text box

Hi all,

I have a basic menu (compatible with IE and N6), the code of which is shown
below.
Is there any way that I can tidy this up - perhaps define the criteria once
only for the entire menu.
It seems like a lot of code for such a simple menu and repeatative in parts.

Also, I take it that it should work with other popular browsers aswell e.g.
Opera.

Sketch

<CENTER>
<table width=100 border=0>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er
width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA,
ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 1</ilayer></layer></td>
</tr>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er
width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA,
ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 2</ilayer></layer></td>
</tr>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er
width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA,
ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 3</ilayer></layer></td>
</tr>

</FONT></B>
</TABLE>
</CENTER>


Jul 23 '05 #1
1 1394
"Sketcher" <sk******@eirco m.net> wrote in message
news:DF******** **********@news .indigo.ie...
Hi all,

I have a basic menu (compatible with IE and N6), the code of which is shown below.
Is there any way that I can tidy this up - perhaps define the criteria once only for the entire menu.
It seems like a lot of code for such a simple menu and repeatative in parts.
Also, I take it that it should work with other popular browsers aswell e.g. Opera.

Sketch

<CENTER>
<table width=100 border=0>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA, ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 1</ilayer></layer></td>
</tr>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA, ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 2</ilayer></layer></td>
</tr>

<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#ffff ff'"><ilayer width=100%><lay er width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'"><FONT COLOR="#000000" FONT FACE="VERDANA, ARIAL, HELVETICA, SANS-SERIF" SIZE=2><B>Item 3</ilayer></layer></td>
</tr>

</FONT></B>
</TABLE>
</CENTER>


Below are two solutions; watch for word-wrap.

Solution 1 uses CSS to reduce code:

<html>
<head>
<title>menues.h tm</title>
<style type="text/css">
td { font-family:verdana, arial,helvetica ,sans-serif; font-size:9pt;
font-weight:bold }
</style>
</head>
<body>
<center>
<table border="0" width="100">
<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#FFFF FF'">
<ilayer width=100%>
<layer width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'">
Item 1
</layer>
</ilayer>
</td>
</tr>
<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#FFFF FF'">
<ilayer width=100%>
<layer width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'">
Item 2
</layer>
</ilayer>
</td>
</tr>
<tr>
<td onMouseover="th is.style.backgr oundColor='#D5E 0B8'"
onMouseout="thi s.style.backgro undColor='#FFFF FF'">
<ilayer width=100%>
<layer width=100% onMouseover="th is.bgColor='yel low'"
onMouseout="thi s.bgColor='whit e'">
Item 3
</layer>
</ilayer>
</td>
</tr>
</table>
</center>
</body>
</html>

Solution 2 requires that JavaScript be enabled on the client's browser.

<html>
<head>
<title>menuez.h tm</title>
<style type="text/css">
td { font-family:verdana, arial,helvetica ,sans-serif; font-size:9pt;
font-weight:bold }
</style>
</head>
<body>
<center>
<script type="text/javascript">
var bgc1 = 'this.style.bac kgroundColor="# D5E0B8"';
var bgc2 = 'this.style.bac kgroundColor="# FFFFFF"';
var item = new Array();
item[0] = "Item 1";
item[1] = "Item 2";
item[2] = "Item 3";
var menu = "<table border='0' width='100'>\n" ;
for (var i=0; i<item.length; i++) {
menu += "<tr>\n";
menu += " <td onMouseover='" + bgc1 + "'\n";
menu += " onMouseout='" + bgc2 + "'>\n";
menu += " <ilayer width='100%'>\n ";
menu += " <layer width='100%' onMouseover='th is.bgColor=#FFF F00'
onMouseout='thi s.bgColor=#FFFF FF'>\n";
menu += " " + item[i] + "\n";
menu += " </layer>\n";
menu += " </ilayer>\n";
menu += " </td>\n";
menu += "</tr>\n";
}
menu += "</table>";
document.write( menu);
</script>
</center>
</body>
</html>
Your code had several mistakes.

1) </FONT></B> is at the end but should follow each set of <FONT ...><B>
tags

2) tags should be paired within each other; that is: your
</ilayer ...></layer> </ilayer></layer>
should be
</ilayer ...></layer> </layer></ilayer>
note the order of the closing tags.

Also, I don't see what the <layer> and <ilayer> tags do.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4065
by: flamesrock | last post by:
First, I'm very new to gui programming, so please go lightly on me :) Ok, so far I've settled on wxPython, and what I'd like to do as a first leap is *convert* a text program into a gui program. It would have a few buttons as function controls and one main scrollable panel that acts like a terminal window. I want to make it so that clicking on a button that performs an operation will output it to the scrollable wxpython terminal panel,...
7
11651
by: Matt Kruse | last post by:
This is a typical layout, but I have specific requirements. I'm trying to figure out a) if it's possible to meet the requirements and b) if so, how. +---------------+ | header | +---------------+ | body | | (scrollable) | +---------------+ | footer |
25
36358
by: Michael Schuerig | last post by:
I'm trying to do something seemingly very simple, but it's brought me close to crushing my head on the keyboard. All I want is a table where the head row is fixed and the body columns below are scrollable (with the ordinary scrollbars, no less). Whatever I try, the columns in the head and the body aren't aligned; the widths are computed independently which gives a completely ragged look. Michael --
3
2219
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of columns. & depending on what the user enters, the data grid can grow very large. So to avoid scrolling the whole page, I just want the data grid to be scrollable. For this I used the <div> tags around the data grid, <div...
2
4093
by: Ben H | last post by:
Hello all I'm using a listview in my app but I want to scroll the listview programatically as I hate the look of the standard scrollbar. So, the listview is scrolled programatically using ensurevisible, ie the listview shows a maximum of 6 items and if I want to scroll down one I use the code... listview.ensurevisible(listview.TopItem.Index + 6)
6
20549
by: abctech | last post by:
Helo Friends, I am a novice Java programmer, I'm working with Jsp + Javascript to develop a web application.I only have basic Html knowledge and I mostly use "FrontPage" to develop my web pages but currently my webpage requires some dHtml and CSS fundamentals hence I'm posting a query in this forum expecting some guidance, I have a floating table in my webpage which I achieved using JS. I have written Jsp code to get database records one...
0
1441
by: Rune Jacobsen | last post by:
Hi all, In my project I have a control (described in an earlier post) which basically consists of three "subcontrols": One big area where the vital data is displayed (scrollable, since it will usually be larger than the window containing the parent control), a time strip on top of it, and a resource list on the left. Long story short - when someone scrolls the scrollable data control, the time strip and resource lists are hooked to keep...
3
2407
by: Nathan Sokalski | last post by:
I am looking to create a multi-column list that is scrollable, kind of like a ListBox control, only I need a way to align the columns of text that I will have (I would use spaces, but because the ListBox normally uses a variable-width font, that would not work). Is there a control like the DataList (a control that uses templates and databinding) that displays the items in a scrollable manner? One idea that I had, although it sounds rather...
1
16973
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2634
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.