Troy III 272 Posting Pro

sorry that will not do, either!
This proves to be more stubborn than expected...
You should use spans, instead of divs if you want them lined in the ceter of the container div and apply display property of inlilne-block
as in this example, since IE will not override DIVs native block property with css command but will add it to the span element.

Here's a working example:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
    <head>
<style type="text/css">
      #centered{
            margin: auto;
            width: 80%;
            padding: 5px;
            background: #eee;
            text-align: center;
            border: solid 1px #777;
      }
      .center{
            width:160px;
            background: silver;
            display: inline-block;
            padding: 0px 10px 0px 10px;
            text-align: left;
            border: solid 1px #777;
      }
</style>
    </head>
<body>
<div id="centered">
<span class='center'>1 This is centered</span>
<span class='center'>2 This is centered</span>
<span class='center'>3 This is centered</span>
</div>

</body>
</html>
Troy III 272 Posting Pro

that's because you are doing it the wrong way, -it is the div2 who should have its margins set to auto and there should be no float.
-Here, try this:

.DIV1 {
   width: 100%;
   height: 70px;
}

.DIV2 {
   margin: auto ;
   display: inline;
   text-align: center;
   width: 80px;
}
nigelburrell commented: Excellent solution +1
Troy III 272 Posting Pro

Hi,

here's the demo, you should atleast have IE6 to be able for this to work.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>http://www.daniweb.com</title>
<style type="text/css">
<!--
li a {
  font-family : Arial, san-serif; 
  color : #FFFFFF;
  text-decoration : none;
  letter-spcing : 2px; }

li {
  border : none; 
  background-color : #365d95;
  padding : .300em .300em .300em 1em; 
  display : block; 
  margin : 0; }

ul, li { list-style : none }

ul {
  background-color : #FFFFFF;
  margin : 0;
  padding : 0;
  text-align : left; }
li.onHover a { 
  color : #365d95; 
  font-family : "Bernard MT Condensed", "Trebuchet MS"; }
li.onHover {
  border : 1px solid #373832;
  width : 160px; 
  background-color : #F80;
  padding : .300em .300em .300em 1em; 
  display : block; 
  margin-left : 1em; }
-->
</style>
<script type="text/javascript">
<!--
var addEvent = function( isEvent, isElement, isFunction, isAttachedTo ) { 
var eventSupported = (( window.attachEvent ) ? 1 : ( window.addEventListener ? 2 : 3 )) || 0;
var installer = {
   1 : ( function( obj ) {
      return obj.attachEvent( "on" + isEvent, isFunction );
   } ),
   2 : ( function( obj ) {
      return obj.addEventListener( isEvent, isFunction, false );
   } ),
   3 : ( function( obj ) {
      return obj[ "on" + isEvent ] = isFunction;
   } )
}[ eventSupported ];
   if ( eventSupported ) {
      if ( typeof( isAttachedTo ) !== "undefined" ) {
         for ( var …
Troy III 272 Posting Pro
<script type="text/javascript">
paragraph = document.createElement("p");
text = document.createTextNode("first");
paragraph.appendChild(text);
document.getElementById('mydiv').appendChild(paragraph);
alert(text.nodeValue);
</script>
Troy III 272 Posting Pro

Hi,
I want to put the div in the middle of the page.
I found one:
pagetext-align: center; but work only with IE.

I've never seen something like : "pagetext-align: center;"
do you mean: [?]page{text-align: center} ?
Cause it should work with all current browsers. [it only centers text of its container though. ]

But if your aim is to center some element on the page but leave the text aligned on its default left, you can do something like this: elementIDorClass {margin: auto; width:40%;} you can add some background-color just to se that the element is perfectly centered. !use strict doctype.

Troy III 272 Posting Pro

lol
you have to many assumptions.
I'd like to know:
Since when are you able to resize the backgound images? 'Cause this is all news to me!

Last time I used png as a background image I did it this way:

#pngImage {
	background: #C01013 url('Image.png') center no-repeat;
	height: nnn px;
	width: nnn px;
	}

for browsers supporting alpha on images natively
and for IE 6 and lower that suppport filter properties:
This new style body after the closed one. <!--[if lte IE 6]> or simply: <!--[if IE]>

<style type="text/css">
#pngImage {
	background-image: none;      
	filter: progid:DXImageTransform.Microsoft.AlphaImageLoader('Image.png'); 
	}
</style>

<![endif]--> Of course it was applied on a DIV element.

Troy III 272 Posting Pro

OK leave everything else as is and since you know some javascripting, than
I suggest you use the browser address-bar for data persistence!
:)

get the "full name" variable and append it to the location string of the following page using "?" mark i front.

than from the following page you will be able to extract the data passed to url after the ? mark, with ease.

Troy III 272 Posting Pro

how much data are you trying to pas to the folowing page?
-cause if it's only a Name and/or Surname, you won't be needing 'php', 'cookies' or similar ...

Troy III 272 Posting Pro

Ordinary html elements are supposed to cascade, therefore they don't comply to "valign" or "vertical-aligng" css instruction statements.

There are hacks but, they spoil compatibility.

some quick solution would be to use positioning of the link container:

position: absolute;
bottom: 0px;

Otherwise I strongly suggest - you use TABLES. :D

p.s.:
in some browsers you could convert dhe container element to a 'table' or 'table-cell' through css-display-property - but thats not widely supported either.

Troy III 272 Posting Pro

I respect your skills too, and I think you are more advanced coder than I am, -just junger. :p

I prefer bref, super-compact, and powerfull clear coding. -I still have a fresh memory of the "dial-up era" when few bytes meant more visits to your page. That's my "signiture", but that's more often just a coding aim, otherwise I let it fail me.
p.s.:
~ (and) I hate the word "standars" ~

Regards.

Troy III 272 Posting Pro

I do not much understand what is going on. The iframe is transparent in all browsers but IE. I need to change the background color in IE, of my iframe and cannot figure it out. My code is below. It is pulling from an external file exfile.js. Nothing i have tried will change the background color, HELP!
------------------------
can I use this function somehow to change the background color??
function change_background() {
document.frames.tickermain.document.body.style.backgroundColor="#ccff6";
// use the frames collection to access the document contained in the IFRAME.
}


[IMG]http://sitepointstatic.com/forums/images/statusicon/user_offline.gif[/IMG]

rgtaylor is right when saying: "OK, I am hoping your code above is broken because of the way you copied it.... BUT... IE defaults a webpage to a white background... Body tag's background is NOT an inherited value... other browsers make everything or almost everything an inherited value... who's right, who's wrong according to the standard... it doesn't matter..."

On the way back to generation 3 and lower browsers the default background color of the page was transparent by default. If no body color was specified -you could se through the page body. Meaning you could see the "chrome" of the browser. Or to put it right the window color (default window color). Later generation browsers default to white.

The problem is that when not specified all other browsers except ie, report the unspecified color as "transparent" - which is incorrect and untrue. Since it's actually white! IE reports it …

Troy III 272 Posting Pro

I havent finished it yet, but you'll have to tell me if it does what you exactly needed.

Here's my work over this deal:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="#css21" media="screen"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="xhtml10S" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Window-target" content="_top" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>Free Live Help!</title>
<style type="text/css" media="screen">
/* <![CDATA[ */

/* ]]> */
</style> 
<script type="text/javascript">
// <![CDATA[
var ie = Boolean((( !!document.all === true && !!!document.getElementById ) ? 1 : 0 ))
window.onload = ( function() {
  var xDiv = document.createElement( "div" );
  var xImage = (( ie ) ? document.all.tags( "img" ) : document.getElementsByTagName("img") );
   var divX = (( ie ) ? document.all.main : document.getElementById("main") );
   for ( var i = 0; i < xImage.length; ++i ) {
   xImage[ i ].onmouseover = ( function( e ) {
     var xImg = new Image();
   xImg.src = this.src;     
     var xHeight = (( this.height ) ? this.height : this.clientHeight );
      var xWidth = (( this.width ) ? this.width : this.clientWidth );
      var posY = 0;
      var posX = 0;
      var e = (( e ) ? e : window.event );
      if ( e.pageX ) {
         posY = e.pageY;
         posX = e.pageX;
      } else if ( e.clientX ) {
         var db = document.body;
         var dde = document.documentElement;
         posY = e.clientY + (( db.scrollTop ) ? db.scrollTop : db.scrollHeight ) + …
Troy III 272 Posting Pro

No.

I'm sorry, but

That is a completely retarded thing to say.

Unless you own firefox.

Otherwise you could've simply stated: "I'ts impossible".

My best regards,
and good luck with your beloved browser. Others might not agree with you, but who cares. You are happy with it? Stay happy!
---------------
p.s.:
I was very sorry for having to write this reply but you don't call a retard everyone who might not share your opinion. Yet, I'm sure that this was only one of those bad days...(we all have them)!

Cheers.

Troy III 272 Posting Pro

I'm not being able to find it, -can you please repeat the answer/solution once again?

Troy III 272 Posting Pro

@OP, Is it even possible to disable/enable a div tag ?

Yes!
Try this:

<div disabled onclick="this.disabled='';alert('thank you!')">Click to Enable</div>

This property is defined in HTML 4.0 and is defined in: World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .

Applies To:
BODY, CAPTION, DD, DIV, DT, FONT, FORM, ISINDEX, LABEL, LEGEND, LI, MARQUEE, OL, P, UL

! This property is inheritable
Try this:

<div onclick="if(this.disabled==''){this.disabled='true';}else{this.disabled='';alert('thanks for enabling us back!')}">Click: Disable/Enable <input type="button" name="button" value="button" /></div>
Troy III 272 Posting Pro

Actually, I answered the OP's question. Something you didn't care to do when you felt the compulsion to share that chip on your shoulder.

Can you please share your answer publicly once again.

Troy III 272 Posting Pro

what method are you using to gat that url in your string?

Troy III 272 Posting Pro

Try wraping it inside another relatively positioned div.

Troy III 272 Posting Pro

Than, please send us the code of your dragImage function so we can see.

Troy III 272 Posting Pro

if your code snippet is correct there's no possibility that the error line is stating: "this.style" - since there is no such declaration in it.
There is some other code interference going one there...(!)

Troy III 272 Posting Pro

Hello Shanti, theImage.offsetTop and theImage.offsetLeft will give you the values you need to display to your user.
Than you can chose where you like to display them.
most probably in: window.status = theImage.offsetTop +" : " + theImage.offsetLeft p.s.:
For the values to get dynamically updated, you should use it inside your imagedrag function.

Regards.

Troy III 272 Posting Pro

I have a couple of form fields within my page...
I have an element that has a form label that cannot be changed via the system and was thinking about changing it on the fly with the getelementbyID and innerHtml methods.

Give an ID to your LABEL f.i.: <label id="yourId" for=... element you like to change and use the provided solution procedure by: ~s.o.s~.

Regards

Troy III 272 Posting Pro

Only through browser specific transition filters.
But for what you ask, the only browser that might produce this particular effect can probably be IE.

Troy III 272 Posting Pro

Hi All,
Is there any way to set the focus to a table row using javascript so that subsequent key press events can iterate through the table rows.Please help me to solve this.

Thanks

As nikesh.yadav already pointed, there are only two true conventional browsers that will handle focus as expected for elements other anchors and forms for certain. That is, IE and FX.

You can write a loop function that iterates through table elements that should receive focus and use a declaration like: tag[i].tabIndex = "auto"; to make them receive focus. This additionally prevents you from breaking the tab order on your document.

It will enable your client to tab through your table rows, cells and/or other desired elements the conventional way, (or browser specific), without having to explain that there are keys with added functionality and how to use them.

Regards.

Troy III 272 Posting Pro

we're going to neer to see your html and css if posible.

Troy III 272 Posting Pro

Okay well im practising my CSS and HTMl skills yet again and have came across a problem.

If you look at this image, you can see my site is perfectly fine. The text is where it should be.

Image: http://i37.tinypic.com/scqqev.jpg

No the text is fine, the navigation looks funny (it only looks funny in the design view. In the browsers and preview it looks perfect).

However, when I preview it or use the internet it does this:

Image: http://i35.tinypic.com/2czd6ig.jpg

See its in design view but it doesnt stop. The text just carries on with the scrollbars getting bigger.

Where I put the white and red lines is where it needs to stop but it doesnt.

Can anyone help me please.
Thank you,
Regards,
Grant

Try breaking your word ie zzzzzzzzzzzzzzzzzzzzdklksdfzzzzzzzzzzzzzzzzssdlfkjsdlgakjlkzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzsslklzskzlkzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzeeeeeeeeeeeeeeeeeeeeeeeels

with regular white-spaces and see what you get. :D

Troy III 272 Posting Pro

you might wana try adding return false .

Troy III 272 Posting Pro

Or, how about replacing that long oldfashion conditional with something compact like this:

var	LoginBox = 
/*IE4*/	LoginBox||
/*NN4*/	document.LoginBox||
/*W3C*/	document.getElementById('LoginBox');
	LoginBox=LoginBox.style||LoginBox;

function hidebox(){
	LoginBox.visibility="hidden";
	}

function showBox(){
	LoginBox.visibility="visible"
	}

hidebox();

One thing I forgot to tell you is that you should never link your script files in the document head if your aim is to manipulate dom style and similar during load time that is on before load event. Placing scripts on document head was allowed because of content prelloading scripts. Script tag is legitimate body element. So this script should also be linked somewhere before the body end tag.

p.s.: not to forget, you should also update the new function name at the lines of function call with the new one. ...showBox(), instead of LoginBox() because that name is now reserved for global var.

Cheers

Troy III 272 Posting Pro

Right i have done that but now the box doesn't disappear at all

That's PROBABLY because your Website - is still NOT AWARE that you've made the change here on your PC. I think you should do something about that.

-How about replacing your old js file with this one on the server?

Troy III 272 Posting Pro

1. You can:Set your initial login box visibility to: hidden.
Your css #yourLoginboxID{visibility:hidden} .

2.Or do it the "right way":
Leave the code as is right now (that is remove the body "onload function call" - as I said in my previous post) and append this function call hidebox() to your external js file, right after the "function hidebox()" end.]

you're a go!

p.s.: Remove the <body onload="javascript:hidebox()"> from all other pages using it.

Cheers

Troy III 272 Posting Pro

Well Sam,
Remove: onload="javascript:hidebox()" from your BODY element and you're OK to go.

(the part i red of the following html code in your document) <body onload="javascript:hidebox()"> Cheers

Troy III 272 Posting Pro

Well, now that you've learned that quotes can be used only in the logic of parenthesis (*) , but not (*] same as "*' etc, and that strings can be added with the + sign and automatically converted into stings when you ad some var value to it.

I also think that you've learned something that 99% of very old javascript coders don't know about Math.min and Math.max and similar, that is - you are not restricted to Math.min(x,y) or Math.max(x,y) only, as scripting reference examples describe it, since there is Math.min(x,y,z,...) .

Please, don't take what you read in books so literally.
Practice! And don't forget that JavaScript is very powerful language...

One thing I don't understand, is why is there no Average Math Object, in Math object collection. Something like Math.average(45,42,47,41,46) , that will return the average numeric value of the group, but that's not so interesting for discussion.

Therefore I've already made one, and introduced it in this example as a Troy III Script to JavaScript Math.object Extension, so that others who might need that functionality may use it also.

So here it is - your last working code rewritten:

<html>
<head>
<title>Implementing Math.average Extension</TITLE>

<script src="Troy III MathAverage.js" type="text/javascript"></script>

<script type="text/javascript">

var stNumber = parseFloat(prompt("Enter 1st number and Click OK", 0));
var ndNumber = parseFloat(prompt("Enter 2nd number and Click OK", 0));
var rdNumber = parseFloat(prompt("Enter 3rd number and Click OK", 0));

var total    = stNumber + ndNumber +  rdNumber; …
nav33n commented: Good work! +8
Troy III 272 Posting Pro

Still doesn't work.

With the following code, the behaviour in IE7 is what I want: The content area stretches to fill the remaining area on the right. The green background correctly fills that area.

In FF, which is not working, the content area takes the entire client area and the data_table extends beyond the right edge causing a horizontal scroll bar to appear at the bottom.

How do I write it such that it works in FF as well?

<html>
<head>
<title>Sample</title>

<style>
body { margin: 0px; padding: 0px; width: 100%;}
div { border: 1px solid #EEEEEE; }
table { border: 5px solid #FF0000; }

#container {
	 width: 100%;	
}

------------------------------ 8< -------------------------------------
</style>

<script>
function toggle(id)
{
	var pane = document.getElementById(id);
	if(pane.style.display == "block")
		pane.style.display = "none";
	else
		pane.style.display = "block";
}
</script>

</head>

<body>
<div id='container'>

------------------------------ 8< -------------------------------------

</div>


</div>

</body>
</html>

I've just tested this code, and there's absolutely no error in FX2 console (costumized to report even the slightest css problems.

I think you are dealling here with the old Netscape content-bleeding problem.

Troy III 272 Posting Pro

Change "Save as type" from "Text Documents (*.txt)" to "All Files" and in "File Name" type name with css file extention like styles.css. Always work for me...

The above, is the correct answer.

You can always determine the desired file type with "SaveAs" command; choose File Type: "All Files", and save it as whatever txt-file format you like including .csv; .js; .css; .htm; .html; .php;...; etc, etc...

Regards

Troy III 272 Posting Pro

Hi there,

My completed code appears below, is there a way for me to submit a screen dump so you can see what I am talking about?

<html>
<head>
<script type="text/javascript">
var firstnumber = prompt("Enter first number and Click OK", "0");
var secondnumber = prompt("Enter second number and Click Ok", "0");
var thirdnumber = prompt("Enter third number and Click Ok", "0");
var total = Math.floor(firstnumber)+ Math.floor(secondnumber)+ Math.floor(thirdnumber);
var average= (Math.floor(firstnumber)+ Math.floor(secondnumber)+ Math.floor(thirdnumber))/3;
var product =Math.floor(firstnumber)* Math.floor(secondnumber)* Math.floor(thirdnumber);
var largest = Math.max(firstnumber, secondnumber, thirdnumber);
var smallest = Math.min(firstnumber, secondnumber, thirdnumber);
alert("Sum: " + total + "\n Average: " + average +"\n Product: " + product + "\n largest: " + largest +"\n smallest:" + smallest +"\n")
</script>
</head>
<body>
</body>
</html>

Yes there is, -there are plenty of image file hosters on the web, where you can upload your image for free [but please save it in a gif or jpg format, -don't link your reply with bmp or tif images if possible ].

Your current code should be working fine by the way.

I will soon post my code.

Troy III 272 Posting Pro

I

function numvalues()
{
if((window.event.keyCode>57)||(window.event.keyCode<48))
			{
			    alert("Only Digits Are Allowed");
				window.event.keyCode=null;
			}
}

Take this:

function numvalues(e){
	if(!e) e=event;e=e.keyCode||e.which;//b.b. TroyIII p.a.e
	if((e>57)||(e<48)) {alert("Only Digits Are Allowed!"); return false;}
	}
document.onkeypress=numvalues

You should use yourElement.onkeypress=numvalues instead!

p.s.: I'm not sure what were you thinking with the window.event.keyCode=null; , but I assumed you wan'ed to dissable it.

Troy III 272 Posting Pro

Yeah that's also a system precaution measure...
I haven't been using this functionality for about 6-7 years now.
I'm not sure,
try ExcelSheet.SaveAs("D:\\TEST.XLS"); , that might supress the confirmation. Or simply close the document with quit command.

Troy III 272 Posting Pro

Check this out when I run the script on ie5 it outputs 44 as the smallest but when I run it on fire fox the output is correct!

Sadly I can not add the print screen on the post as when I click the image link it ask for a url

That's impossible, becasuse "Math.min" and "Math.max" are implemented in javascript version 1.0 and the IE5 uses, at least JS v1.1 engine.

You have introduced some other error in your code or input. alert(Math.min(120,845,12,8744,1,10,0,-278)) will return -278 (correct since it's the smallest number in the sequence) in all of the browsers supporting this object, otherwise you'll get an error, but never 0, nor 1 or 10 or some other wrong value!

Why don't you send us the code you are currently using to see if we can reproduce your wrong result?

Troy III 272 Posting Pro

There's no difference between using divs or images cause if you wrap div in link tag it will act same as wrapped link image.

Troy III 272 Posting Pro

OK
try: alert("The Sum is:" + total + "; The average is: " + average); , to alert them both in one turn.

try:

var largest = Math.max(firstnumber, secondnumber, thirdnumber);
var smallest = Math.min(firstnumber, secondnumber, thirdnumber);

alert("smallest:" + smallest + "; largest: " + largest )

to remove the junk you use for this simple task: meaning following:

if(firstnumber > secondnumber && firstnumber > thirdnumber){
var largest= firstnumber;

}
else if(thirdnumber > firstnumber && thirdnumber > secondnumber){
var largest= thirdnumber;
}
if(firstnumber < secondnumber && firstnumber < thirdnumber){
var smallest= firstnumber;
}
else if(secondnumber < firstnumber && secondnumber < thirdnumber){
var smallest= secondnumber;

taht can't posibly be working!

Troy III 272 Posting Pro

try this site (http://layouts.ironmyers.com, might help you alot.

Grantmitch1 commented: Awesome +1
Troy III 272 Posting Pro

"average" has to do with, do it yourself math: ( a + b + c ) / 3, as in primary school.

sunny, you are again deliberately messing with quotes
("Enter second number and Click Ok", "0

you don't need it especially if you haven't writen O instead of 0!

your elseif
is one hell of a junk, there is only one elseif in both real life and in coding.

and there can't be the largest or the smallest "product" you mean "sum" of 1+2+3; -what on earth were you thinikng? the smallest and the largest is always the exact same value of 6,
etc etc ...

Troy III 272 Posting Pro

Hi All,
I have 3 horizontal tabs menus with different form to let user key in some infor to the text fields.

When user 1st time access this page, all fields are blank. But if user want to go to the second tab, user must key in some infor at the 1st tabs form. How do I check if user didn't key in anything in the 1st tabs form? I want to force user to key in the 1st tab's form in order to allow user to click the second tab form and 3rd tab form.

What I want is if user didn't key in anything at the 1st tab's form, an alert will prompt out and tell the user to key in the text in the textfield at 1st tab form and save the data into mysql DB. Or else he can't even pressed the second tab form or 3rd tab's form.

How should I proceed with this requirement.

I using yui tabview to show the tab menu. All the form is within the same page.

Here is the sample of how my tab menu look like: http://developer.yahoo.com/yui/examp...rommarkup.html

So when user click 1st tab and then to next tab menu, i need to verify if user is allow to click 2nd tab. Or else force user back to 1st tab. Each tab will have a <div id=tab1>content</div>.

I am using php and mysql for data storage. I think of using javascript to do this but my …

Troy III 272 Posting Pro

You can't supress it because it's a System alert! You are overwriting an existing file.

Try: ExcelSheet.Workbooks.Open("D:\\TEST.XLS", 2, true);

Troy III 272 Posting Pro

... All I manage was the sum part...

As a matter of a fact - your code will give you absolutely NOTHING!

Let me first explain you few things,
-now that you've learned that Java and JavaScript are two completely different languages, there is no single line in your code where you didn't put at least one [?deliberate!] error.


vars can be declared either separately:

var one;
var two;
var three;

or grouped with one keyword in a comma-separated list:

var one, two, three;

This will produce another error:

var one, tw o, three;

there is no comma between "tw" & "o", or there is an illegal whitespace in the name of var.
(your number 1 error reproduced).

You've commented your script <!-- ... <-- , this can never happen to be one of a "new to Java" error.

You have deliberately missmathched quotes window.prompt( 'Enter the first number", "0" ); in every single line required.

You've managed to switch "I" with "L" in every parselnt( firstNumber ); function counting on similar visual representation of I and smallcaps L in fonts currently used.

Finishing with your special mess:

window.status =( sum: " + sum + ");

using undefined sum: but converting the existing "sum" var into a string literal with no meaning at all.

Not to forget your prime error <script type="text/javajscript"> requiring the browser to use an unknown and inexistent scripting language to interpret …

Troy III 272 Posting Pro

-----DIV-----------------
[div] X
[ background image ]
--------------------------

...is one of the ways to go.
You can use the css to position & style the "x" letter with border box etc.
Now, what's eating me is: are you planning to show it anytime later after it is closed or not?!!

Troy III 272 Posting Pro

Please help the question appears below and my so-called attempt appears after that as you can see I am relatively new to java, I only manage to do the sum part.

Write a script that takes three integers from the user and displays the sum. average, product, smallest and largest of the numbers in an alert dialog.


<script type="text/javajscript">
<!--

/*
var firstNumber,
secondNumber, //this, and the following will produce errors
number 1,
number2,
number3,
sum;
*/
//you should declare your vars in one line when grouping:
var firstNumber, secondNumber, number 1, number2, number3, sum;

firstNumber= window.prompt( 'Enter the first number", "0" );

secondNumber = window.prompt( 'Enter the second number", '0' );
ThirdNumber = window.prompt( 'Enter the third number", '0' );
number1 = parselnt( firstNumber ); number2 = parselnt( secondNumber );number3 = parselnt( ThirdNumber );
sum = number1 + number2 +number3;
/*
window.status =( sum: " + sum + "); //this is where your code should fail completely!
*/

window.status = "sum: " + sum;
/*<--*/
-->
</script>
</head>
<body onload="window.prompt;">

</body>
</html>

When I run the above noting happens, the screen is absolutely blank and there’s no errors. This is for an assignment.

Your question is JavaScript related all right, but your code contains some errors. Whatch for portions marked in red.

Troy III 272 Posting Pro

They're using area maps and image holder for at least 36-50 pictures depending on example viewed.
The mouseover event on area to bring up the corresponding image frame. But the animation uses some script obviously.

I believe there must be some other way to compensate for this great number of areas defined.

But this method must be no - script compatible and should work with javascript disabled browsers too.

[sorry it doesn't!]

But I'm 198% positive it can be made to work without JavaScript also.

regards

Troy III 272 Posting Pro

Hello evank,
What you need, - is a container you already have, and images that will fill the line.

*[ you should consider closing your img tags properly depending on DTD specified.]

If you plan for images to be scrollable with the browser-built horizontal scrollbar. You can use the following CSS:

#yourImageContainer{
	width: /*your desired area width*/;
	height:/*images height, or at least 1px higher than your images */;
	overflow: auto;
	white-space: nowrap; }

It will make your DIV image container display a horizontal scrollbar.

But in case you plan to scroll them with javascript, than overflow:hidden is the way to go.

/inf.:
Images are inline elements. They're allowed to break in a new line, just like text content does, in case it doesn't fit in existing available width.


Regards

Troy III 272 Posting Pro

I guess that my statement:

This thread should have been marked as solved by MidiMagic by now.

was not well-formed and can be interpereted incorrectly.

To avoid confusion, I should have used quotes like in:
This thread should have been marked as "solved by MidiMagic" by now.

Meaning:
thread Status = "solved";
solution Author = "MidiMagic";
marker ID = "";
----------------
Marker ID vas not defined.
Regards.