Troy III 272 Posting Pro

Is this tinny problem solved, or should we continue giving other solutions that will not work, on top of the working one?

Troy III 272 Posting Pro

Here,

First thing you should do is to remove your script from HTML element and place it somewhere before HEADER element closure.

Second:
Something on the right should follow something on its left, not the opposite, this adds confusion.
Put your HTML back to its normal order of its rendering flow, like this:

<DIV class=body>

 <DIV class=bodyTxt>
  <DIV class=bodyTxtInner>
	<H1>HOME</H1>
	<P>Gary Jones and Rick Taylor are the owner/operators (under the direct 
	supervision of their wives Janice and Carol) of the 
	<SPAN class=yellow><STRONG>
	Cypress Hill Winery</STRONG></SPAN>.
	 The current location 
	was opened in June, 2009.</P>
	<P>This small urban winery is in the lower level of an old sandstone and brick 
	building located in the downtown Carrousel District of Mansfield, OH. This is a 
	true wine cellar where the tasting room is situated in the midst of a working 
	winery. The exposed stone walls, the oak wine barrels and the rustic 
	surroundings all contribute to the ambiance and relaxing atmosphere. 
	</P>
  </DIV>
 </DIV>

 <DIV class=floatyImg>
  <IMG height=362 src="images/hompageImages.png" width=400>
 </DIV>

</DIV>

So you won't need the "z-index" anymore.

Third, - the CSS:

.body {
	background: url("images/BG.png"); 
	overflow: auto; 
	width: 100%; 
	height: 379px; }

.bodyTxt {
	padding: 5px 0 5px 10px;
	background: url("images/bodyBg.png"); 
	width: 400px; 
	color: #fff; 
	-moz-border-radius: 20px; 
	-webkit-border-radius: 20px;
	position: absolute;
	margin:10px; /* optional */}

.floatyImg {
	float: right;
	width: 400px; 
	position: relative;
	margin-right: 20px; }

.bodyTxtInner {
	padding: 0 0 0 15px; /* optional */
	width: 265px }

additionally

.separator {
	background: url("images/separator.png"); …
Troy III 272 Posting Pro

Yes. There's no need for <p> element in front of <li>, so no, you don't have to.

Otherwise I must confess I hardly understand your question, if at all. But I will presume that your problem is solved.

Cheers.

Troy III 272 Posting Pro

You should correct your HTML errors first

Troy III 272 Posting Pro

1. I do not understand why you say it doesn't exists.

2. There are 10 txtrate fields, txtrate1 to txtrate10
asp:TextBox ID="txtrate1"....
not html fields.

index is 1 to 10.

3. Again it works in MSIE but not FireFox.

4. I also do not see the difference between yours and mine except for the spaces around +

Yours
var _rate = "ctl00$ContentPlaceHolder1$txtrate" + index;
var rate = document.getElementById(_rate).value;

Mine
var _rate = "ctl00$ContentPlaceHolder1$txtrate"+index;
var rate = document.getElementById(_rate).value;

5. What am I missing?

:')
Are you putting that script in the document header???
Because if you aren't, you shouldn't read this.

1. getElementById() returning null, always has a meaning that the element of that query is not available.

2. I know there are at least 10 elements you are trying to handle there. It doesn't matter if they are text-box or input fields or divs or whatever for as long as they are available to the script, so the culprit is elsewhere.

3. I've tested the code in IE6, FX, Opera9 & even Flock before posting it , - and it worked as expected in all!
This picture proves that your code in my order is working on FX too! http://i27.tinypic.com/2qnursj.png
Didn't test in Safari though, and I'm sure even with this code order, you will be getting back that "null".

4. In fact, there's nothing wrong with your code at all, they're both exactly …

Troy III 272 Posting Pro

I invite you to examine this example http://www.daniweb.com/forums/post948604.html#post948604

But I'm sure you already did that with no avail.
Here is my valid cross-browser working code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title>Table Emulator</title>

<meta http-equiv="content-type" content="text/html;charset=utf-8">

<style type="text/css">
*{border:none; padding: 0; margin: auto; overflow: auto}
div, span {border: solid 1px gray}
span {display:inline-block; vertical-align: middle;}
</style>

</head>

<body>
<div id="header" style="width: 901px;">
   <div>
   <span style="height:30px; display:block">
   your content here
   </span>
   </div>
   <div>
   <span style="height:50px; width: 150px;">
   your content here
   </span><span style="height: 194px; width:657px;"> <!-- prevent white-space addition on non-IE agents -->
   your content here
   </span></div>
</div>

</body>
</html>

Advice:
As you already know, -for png transparent images on IE, you will need alphaImageLoader. See my strategy of using AIL in cross-browser compatible way on a document that validates in both tests here :http://www.daniweb.com/forums/post950195.html#post950195

Troy III 272 Posting Pro

Hey Everyone,

I want to replace the following code with it's DIV equivalent.

<body>
<div id="container">
<div id="header">
<table width="901" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" style="padding-left:20px"><img src="images/thinktankname.png" alt="Think Tank for African American Progress" /></td>
  </tr>
  <tr style="padding-bottom:20px">
    <td style=" padding-right:10px"><img src="images/thinktanklogo.png" alt="think thank logo" /></td>
    <td><img src="images/thinktank.jpg" width="657" height="194" /></td>
  </tr>
</table>

</div>
</div>
</body>

When I tried two floating divs the images are in the right spots but the background color of the containing div doesn't show behind them. I get 2 different incorrect results from both IE and Firefox.

<body>
<div id="container">
<div id="header">
<div><img src="images/thinktankname.png" /></div>
<div style="float:left"><img src="images/thinktanklogo.png" alt="logo" /></div>
<div style="float:right"><img src="images/thinktank.jpg" /></div>
</div>
</div>
</body>

Here is some of the CSS:

body{
background:#faca0a;
background-repeat:repeat-x;
background-image:url(images/background.jpg);
background-position: top;
}

div#container{
	font-family:Arial, Helvetica, sans-serif;
	font-size:10pt;
	color:#660033;
	margin-left:50px;
	margin-right:50px;
	padding:0px;
	background-color: #660066;
	text-align: justify;
	top: 0px;
}


#header {
	padding-left: 20px;
	padding-bottom: 10px;
}

I invite you to examine this example http://www.daniweb.com/forums/post948604.html#post948604

Troy III 272 Posting Pro

For a start, -that's because there is no container element with ID "page-nav" in your html content. And that "#page-nav" css selector is targeting contained list-items on nonexistent element.

Troy III 272 Posting Pro

Those scripts are affiliates of the main third-party spy-ware script, trying to communicate data with it, and it is something you shouldn't worry about at all!

Restricted zone is not enough of a measure for most of them.

You should use something more efficient, pure and lightweight instead of these memory consumer applications which are spies themselves.

Here is a better measure:
You should add those lines to your Hosts file.
To do that:
Create a shortcut somewhere and edit its target like this: %windir%\NOTEPAD.EXE %windir%\SYSTEM32\DRIVERS\etc\HOSTS (copy-paste and save those changes)

Than double-click the icon to open the file in Notepad and find a line stating: 127.0.0.1 localhost and right, (under this line) add statements like:

127.0.0.1  a1.interclick.com
127.0.0.1  campaigns.interclick.com
127.0.0.1  ad.interclick.com

to effectively block those addresses without any risk of downloading malicious content before your 'guardian' finds out where it is coming from and consumes memory while deciding what to do with it.

This measure will completely block anything and everything suspicious from your list - right before your browser even sends its request to that server. Meaning, it will not even allow the request to be made at all.

Troy III 272 Posting Pro

First, let me say that I'm an amateur with HTML and web design so please try to keep your explanations as blunt and frank as possible. Thanks in advance!

I'm wanting to have a repeating background image behind another fixed, non-repeating image.

This is the following code I have so far:

<style>
body {
    margin-top:0px;
    height:100%;
    background:url(Boneyard.png);
    background-repeat:no-repeat;
    background-position:top center;
    background-attachment:fixed;
}
html {
    margin-top:0px;
    height:100%;
    background:url(background.png);
    background-repeat:repeat;
    background-position:right top;
    background-attachment:fixed;
    background-color:transparent;
}
</style>

The fixed image appears but the background remains white without the repeating background appearing at all.
Please, help? Let me know if you need any more information.

It can be achieved but ...

<style type="text/css">
html, body { border:none; margin: 0px; padding: 0px; 
      background: #fff url("background.png") right top fixed; }
body { background: transparent url("Boneyard.png") center top no-repeat fixed; padding-top: 1px; /* Mozillas/Opera fix!!! */}
</style>
<!--[if IE]> 
<style>
html, body { height: 100%; width: 100%; overflow: auto;  padding:0}</style>
<![endif]-->

Use it with precaution.

Troy III 272 Posting Pro

Hi,
The slider on the site below works fine in Chrome and FF but in IE is showing a scroll bar on the right and the images scroll vertically . Any help is appreciated.

http://www.alias-dev.com/gig

it's a coda slider http://www.ndoherty.com/demos/coda-slider/1.1.1/

Sorry but the coda-slider 1.1.1 working perfectly on my Internet Explorer version 6.

After all, that slider code was invented by IE guys first.

Troy III 272 Posting Pro

stay away from that site and block them.

few notes on interclick.com
http://google.com/safebrowsing/diagnostic?site=interclick.com/

i suggest you block these addresses:
www.interclick.com
a1.interclick.com
campaigns.interclick.com
ad.interclick.com

there should be more ....

stvrich commented: helped confirm my own feelings on this, tanx +1
Troy III 272 Posting Pro

Script works in MSIE but not FireFox (part of a VB.NET 2005 web site)

There must be a place in FireFox or a JavaScript settings somewhere that allows errors to continue.

The below works in MSIE
var _rate = "ctl00$ContentPlaceHolder1$txtrate"+index;
var rate = document.getElementById(_rate).value;

index = 1 to 10 for each row on the page. In this case it is 1 (the first).

But it the FireFox java errors it gets a null and terminates.

Why is it getting a null. It works fine on MSIE.

That's because the element: "ctl00$ContentPlaceHolder1$txtrate"+index; doesn't exist!
The document built-in function [getElementById()] is written to return "null" when element with that id is not found. Therefore, that report should be considered correct.

Here is your working code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>dollar sign in ID attribute</title>
</head>
<body>

<div>
<input id="ctl00$ContentPlaceHolder1$txtrate1" value="Input 1">
<input id="ctl00$ContentPlaceHolder1$txtrate2" value="Input 2">
<input id="ctl00$ContentPlaceHolder1$txtrate3" value="Input 3"> 
</div>

<script type="text/javascript">
var index = 1 //to enable test: index value set manually! 

var _rate = "ctl00$ContentPlaceHolder1$txtrate" + index;
var rate = document.getElementById(_rate).value;
      alert(rate);
</script>

</body>
</html>

If you need further explanations ( on "why is it working now?" ), please don't hesitate to ask.

Regards

Troy III 272 Posting Pro

Sorry my missunderstanding,
anyway, its an adware and a spyware blocked from my security. :)

Troy III 272 Posting Pro

You should try to find some replacement for that dollar sign of yours.

Troy III 272 Posting Pro

Interesting ...
It works on IE6 supporting javascript up to version 1.3 only!

But it fails on FX v3.5.2 supporting javascript 1.5, and reporting to support javascript up to version 1.8.
I am puzzled???

(Works in Opera also)...

Troy III 272 Posting Pro

The link to your blog page you just provided:
http://www.kyleschaeffer.com/best-practices/pure-css-image-hover

But there is more...

Troy III 272 Posting Pro

harry010,
what is this code doing on your site?

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-5789165-1");
pageTracker._trackPageview();
</script>

It is rising error on my firefox v3.5.2

Troy III 272 Posting Pro

You are using a fixed width for 1024 resolution most probably for the width of your iframe specified in px - delete it/replace it with "100%"!
This way the browser will be allowed to adjust its width according to the space available.

Troy III 272 Posting Pro

You are twisting the issue...
Your statement was: <img height='100' height='100' alt='alt text' style='float:right'> "works as expected with the sizes specified"

Meaning, it will not work without size specs.
But that's missinformal and untrue since <p><img src="picture.gif" style="float:right">...</p> will work perfectly and -especially as expected!

I'm a coder, not a sourcerer. And I was not in possition to pressume that his image is 100x100px of size as you did - so what if your code enforces his f.i: 170x90px to get stretched and squeezed sametime.

This is the reason why I didn't give myself a luxury to specify the hight and width of an image I never saw before, and especially not when dealing with: how to make text wrap arund image without dropping all other lines under it and especially, and because alt='' height='' width='' or any other attributes are a part of his duty and their values out of my knowlledge and precognition abilities.

Tip: It is a good practice to specify both the height and width attributes for an image only when you know its dimensions and absolutely sure that the source image will be available. Otherwise, if these attributes are set, the space required for the image is reserved and when the page is loaded your paragraphs will render unequal and without a visual clue of a missing image that will make your page look ugly. However, without these attributes, the browser does not know the size of the image, …

Troy III 272 Posting Pro

Should be very easy. Just move the <p> BEHIND the image specification.

That was my answer to cab_driver, and there is nothing wrong with that code, yet in rare cases when the image has (contectually) nothing to do with the text content, your suggestion will be better siuted, but thanks anyway.

Troy III 272 Posting Pro

why do you suggest using " height='100' height='100' " when <p><img src="picture.gif" style="float:right">then add my text,... , will be more generic and will work for all sizes of a given image?

Troy III 272 Posting Pro

I think i got the solution..!!
we can change id even in CloneNode.>!! :)
.
.
Thanks to everyone who response to this thread..!! :)

Of course you can. :') -good luck with your further codding.
Glad you solved it.

Troy III 272 Posting Pro

... + i++

Troy III 272 Posting Pro

I'm pretty sure I did exactly that - and please don't call me Duch.

Troy III 272 Posting Pro

Any success with Opera?

Troy III 272 Posting Pro

You are right - but I don't se how somebodys attitude toward politeness and patience of another has anything to do with racial questions. Sorry you feelt that way, but I think that's a pure and acurate observation, nothing more or nothing less. Taking advantage on anothers patience and politeness to my judgement is a greater sin. But I'll keep in mind that vulgarity swears and other offences are wellcome. Or is it just my wrong impression same as yours happens to be?

Troy III 272 Posting Pro

IE 6 doesn't support transparent PNG's . You could use a gif if you want transparency. If you use any other file type, you need to make sure the background (the part you want transparent) is the same color/pattern as whatever you're placing it on, this way it will appear transparent.

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

In conjunction with:

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

Will give you a PNG transparency support in all generation 4.1 browsers.

Troy III 272 Posting Pro

he is talking about focus (element selected) outline; otherwise 'a tiny dotted border around the element that recieved focus'. But, css declaration " outline: none; " will work only in mozillas.

IE offers outline:expression(hideFocus='true') or an inline statement hideFocus='true' although not a requirement because in IE this outline doesn't affect the page layout, while in mozilla it does.

On the other side Opera doesn't offer any kind of means to do that, allthough it doesn't affect the document, and normally would not be a requirement, it does affect your design and your menu links may get ugly on keyboard navigation because on top of a fancy border around the elment, it also selects its content forcing the text content to have a navy background color.

- If anybody found a 'cure' for this in Opera, ..would be much appreciated.

Troy III 272 Posting Pro

You are using the same CSS in both files I guess. Editing that will affect all pages using it.

Troy III 272 Posting Pro

-did that work in opera?

Troy III 272 Posting Pro
[B]<p><img src="picture.gif" style="float:right">[/B]then add my text, but it only seems to allow one line of text, then everything else drops beneath the image. I've looked at various sites and they all say that this is how it's done. Does anyone els have a suggestion?[B]</p>[/B]
Troy III 272 Posting Pro

I was wondering if anyone could help me out with this issue. I am creating a basic function that will handle movement of an item that is absolutely positioned on a webpage (function moveElement). I begin with the onload event item which calls function prepare which calls function moveElement with the specified parameters. elementID is the HTML id of the item to be moved, finalx is the x-coordinate it should be moved to, finaly is the y-coordinate it should be moved to, interval is for the setTimeout function, and steps is how many steps it should take for the object to get there.

I have placed alert boxes to test the function. The first call from prepare displays all teh alert boxes and the varibles they hold, but the setTimeout doesn't seem to be working. Whenever the code reaches that point, when it supposed to trigger the alerts from the second call of the function, it doesn't do so. So could some one help me figure out this problem? thanks

window.onload=prepare;

function prepare()
{
	var item=document.getElementById("preview");
	item.style.top="0px";
	item.style.left="0px";
	moveElement("preview",200,400,25,50);
}

function moveElement(elementID,finalx,finaly,interval,steps) 
{	
	var item=document.getElementById(elementID);
	var currx=parseInt(item.style.left);
	var curry=parseInt(item.style.top);
	var xdist=finalx-currx;
	var ydist=finaly-curry;
	var xincr=xdist/steps;
	var yincr=ydist/steps;
	
	alert(currx);
	alert(curry);
	
	currx+=xincr;
	curry+=yincr;
	
	alert(currx);
	alert(curry);
	
	item.style.left=currx+"px";
	item.style.top=curry+"px";
	steps=steps-1;
	
	alert(item.style.left);
	alert(item.style.top);
	
	var mover=setTimeout("moveElement(elementID, finalx, finaly, interval,steps)", interval);
}

The problem is related to: missing variable values!

The "var mover=setTimeout("moveElement(elementID, finalx, finaly, interval,steps)", interval);" is passing empty vars to the function at the very first step of the timer call.

This will …

Troy III 272 Posting Pro

hahahaha...
essentiall.bullcrap.stupidity >= infinite
I gave you code instead you are giving essential bull and swares - 'cause that's the only thing you think will work when your code doesn't.

Well guess what, - your swares are cheap and crapy too! But keep it on, your badass atitude might just improove when you least expect it.

Troy III 272 Posting Pro

Only a coward, and some of them half-educated far-East gypsies will consider somebody else's patience and politeness, as a weakness.

Mr. essential bullcrap.

And I was being polite and patient to my honour, not yours.

Troy III 272 Posting Pro

But if you are interested to read also, here is your short scripting strategy that will work 'cross-browserly'.

It is you, and your disfunctional code who's complaining! So,
I corrected your crap to become of some use.
Opera is a hybrid, and to some extend it will support both proprietary models. Meaning, - if some code works on both O and IE, it will most probably fail in mozillas, and vice versa.

As you've already noticed, the only line kept, and not thrown as a total crap, -is, that silly conditional bull you wrote, and that's only because of my standing point: that when something is working, even if it's a totall bull, will need no fixing! Everything else is mine and should not be used without my signiture - especially not my equilizator and moreover not my original syntax class assignement switch.

And I strongly recommend not to use this kind of conditionals if(e.nodeName.match(/a/i) && e.parentNode.parentNode.id == "demo" ) whenever possible, especialy not in extreemly frequent repetitive calls like mouse-overs/outs fixed to global events forcing the browser go through a double-trouble decision making just for taking some silly action or decide not to.

Your silly aproach is nothing new to me - I've written that kind of functions back in 1998 for that matter. And I modified your code for you to be able to understand where were you going wrong.

-What key events?!! -Which function?! - Find me a browser that cannot …

Troy III 272 Posting Pro

I am writing these lines for our silent readers - not namedly for you or any other member explcitely involved in this discussion!
'Cause I know you know all about coding and scripting - I'm writing these replies for causal readers.

But if you are interested to read also, here is your short scripting strategy that will work 'cross-browserly'.

document.onmouseover = document.onmouseout = function(e){
	e=e||event;e=e.srcElement||e.target;
	if(e.nodeName.match(/a/i) && e.parentNode.parentNode.id == "demo" ) {
      var p = e.parentNode.className; p=p?"":"onHover";
	e.parentNode.className = p
	}}

But I wouldn't reccomend it because its unnecessarily CPU expensive.

Troy III 272 Posting Pro

@TroyXXX

That's pretty basic if you can't get the lines:

onmouseover = omouseout = function(e ) { ... };

// same ASS:

onmouseover = function( e ) { ... };

onmouseout = function( e ) { ... };

if your IE can't get to it, the im pretty sure other browser will consider those basic line and execute the function.
So don't be such a stubborn kid and stop crying for the things, that is not intended to your deal...

- I think you should consider Airshow's suggestion, and read more stuff in the W3C standard recommendations, instead of inventing your own things...

Hahahaha
I wonder thou, how did you learn the things you come to know by now.
Or you didn't even bother to understand that error. onmouseover = function( e ) Means that you are assigning a function to a globalscope variable named onmouseover - not to the event with the same name kid.

So, what your're relying on to get that function runing is a pure proprietary mozilla bug!

And I dont give a damn about W3C comunistic scumbags.

Troy III 272 Posting Pro

I agree, I should have stated: "in this, and all other ordinary cases where regular properties are inheritable by nature..." but that would be to long of a statement for making such a short point wouldn't you agree.

Troy III 272 Posting Pro

'Inherit' is a 100% good cool CSS attribute. It's in the CSS2 and CSS3 recommendations - maybe CSS1?

Unfortunately (I read here) Internet Explorer 7 and earlier versions don’t support the value inherit for any properties other than direction and visibility. IE also throws an error if you try to set 'inherit' inappropriately, but it is catchable (I just tried in IE6).

Airshow

Inherit is an internal command, doesn't need to be stated.
Properties are cascadingly inherited from the parent towards all of the children of any element. And that's the core logic of CSS.

<body>
aaaaaaaaa
<div>
bbbbbbbbb
<span>
cccccccccccc
</span>
bbbbbbbbb
</div>
aaaaaaaaa
</body>

Now, if you specify "color:red" for the body element all other elements will have that color unless overriden from its children.
Than if you state "color: blue" for the contained div a will remain red, b will become blue, but also the c. There is no logic to go state "color: inherit" for the span element for it to take the color of its parent, otherwise css would be a total waste.

Inherit should be used only for properties that are NOT inheritable by definition.

Troy III 272 Posting Pro

As far as i'm concerned all of those methods and properties that i have used over the last posted function are well supported in IE5.5+, so i keep wondering why still it didnt work inside your IE6-version!? parentNode, nodeName, srcElement would be enough to penetrate IE5+ mode. If that doesnt work, then don't bother wasting your time running the script.

I don't have to run one script over and over again to understand that it isn't working. I knew that it will not work even before I tested it. "parentNode", "nodeName" etc are not the issue.

I will point you to the first major error on your function
and that's the very first line: onmouseover = onmouseout = function( e ) You find out why.


p.s.:
A Hint


Try this:

function onclick(e){//b.b. Troy III p.a.e.
        e=e||event; e=e.srcElement||e.target; e=e.nodeName;
        alert(e);
}
document.onclick = onclick;

If you execute this code in FX, you'll get the alert report twice, which is a general mozilla bug, and all the netscape broods have it; -and this bug is the only reason why your function is even triggering there.

Troy III 272 Posting Pro

can you give me an example of how did you use a "hidden variable" please so I can look into it and see what's the problem?

Troy III 272 Posting Pro

It wuldn't do, I told you that there is no 'inherit' property either way.
Some browsers like mozillas -won't rise an error on wrong css selector asssignements through js but will silently fall back to the default selector stated in style if any.

You should use an empty string, or (in this casse) the correct className instead. Or assign some other selector but not "inherit" since there is no such thing exposed to javascript methods as far as my knowlledge.

And it's not the inlinescript the thing that is not working on IE its simply thows the error but also falls back to default and changes the color to white on hover.

What is not working is the whole function...

Troy III 272 Posting Pro

I am truly sorry to disappoint you - but it doesn't!
there's no such thing as "inherit" (line 63): onmouseout="this.style.background = 'inherit';" In some browsers it will simply assign invalid value. - that is: nothing -and the browser will be forced to use the default, but in other -it will rise an error that might interefere with other lines of code to... but not in this case.

Yet, correcting that inline code -will not help either. This code will never run on explorer even if corrected, since you will also have to correct the html structure.

Troy III 272 Posting Pro

-Here, try this stunt: (I never tried it)

Write it in the hidden input of the first page - I'm almost sure the Back-Button will not clear its value - and than read it back with your script.

!But, beware that any other way of geting back to the first page, ie clicking a link to it will most certainly clear your var value!

Troy III 272 Posting Pro

My script was not accessing children inside the collection - it was accessing a filtered collection of exact elements explicitly from the container specified.

And in case you later need to manipulate their children or parents; adding: return coll at the end of the function would provide you with ready to use collection any time you need to further manipulate parents or their children.
Or you could do it inside the function directly.
for instance: coll[i].parentNode.onmouseover= ... And the call: document.hoverElementsBy("demo", "li", "onHover") can be used anyway you like adn on any existing tag element on any container with an ID:
document.hoverElementsBy("demo", "a", "onHover")
or even
document.hoverElementsBy("demo2", "div", "backgroundNew")
or
document.hoverElementsBy("demo", "b", "adborder")
etc etc...

But that was not my point...
I allready told you that: http://www.daniweb.com/forums/post932988.html#post932988

I was hoping that you will get my point yourself and I was pretty sure you'll get to this conclusion by now without me having to point it out:

There is nothing more compatible than DOM Level NULL, - that is: DHTML!

A coder with a damn experience will develop his code from its roots, not the other way around. And will begin to implement new level extensions only when absolutely necessary.

I will never even open a <script type="text/javascript"> tag, before I really need it.

It is not our duty to support future browsers, it's the other way around - future browsers are, should …

Troy III 272 Posting Pro

It is you who argued that my code will break in case somebody tries to use some sort of wrong nesting or even a MOUSEOVER event on a nested LI element.

But that super-short script of mine, factuated to bee buletproof even in a badass html structure situations.

So what is your problem than!
I really don't know what you are "chating" about?
Your redoundant code is still not working on my Explorer.

You take my correct [last example] code from the previous post AND test it against any capable browser and handheld devices including your nokia running on Opera v.86.5. AND TEST IT. -Because I don't have one!

Than come back complaining to me, but meanwhile we could use some working code instead.

And please don't come back to argue about CSS if it's not displying properly because I used the one you supplied here, and I'm not to blame if that verison of opera you have is not capable to render exactly as you stated in your CSS. [ the only change I made is that removed indent you gave to hover-class] 'cause anyway we are talking JavaScript here.

And please don't point me to PPK's pages cause I've known him since his very first beginnings on javascript.

Troy III 272 Posting Pro

When you say:

"I'm tempted to resort back to HTML tables"

and before you do that, - I envite you to see this:

http://i25.tinypic.com/23hwphk.png [sorry I dont see how I could link to an image here!] (That's how it will look on IE 6)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>center elements</title>

<style type="text/css">
      #centered{
            margin: auto;
            width: 90%;
            padding: 3px;
            background: gray;
            text-align: center;
            vertical-align: middle;
      }

      div span { 
            display: inline-block;
            background: #fff;
            margin: 1px;
            padding: 2px;
            font: normal 10pt tahoma;
            padding-left: 10px;
            
      }
      span b {
            position: relative;
            display: inline-block;
            width: 2em; 
            background:gray; 
            color:white
      }
      
      span span {
            width:160px;
            background: silver;
            display: inline-block;
            padding: 0 10px 0 10px;
            text-align: left;
            margin: 2px;
      }
</style>

</head>

<body>

<div id="centered">
<span>
<b>A</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>B</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>C</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>D</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>E</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>F</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>G</b>
<span>1 This is centered</span>
<span>2 This is centered</span>
<span>3 This is centered</span>
</span>
<br>
<span>
<b>H</b>
<span>1 This is …
Troy III 272 Posting Pro

Thanks Troy III... your solution works well!!

It's funny, but it's seems a bit strange to me why DIVs are so problematic in these situations. In moments like this I'm tempted to resort back to HTML tables, and that's saying something... the very thing DIVs are meant to replace.

But thanks for replying and providing a solution... I've tried it in my code, and it does the job perfectly!

By the way, are you aware of any issues with inline divs that Airshow refers to in his post?

Tables should be used fort tabular data only.

Divs are block-level, do-nothing containers, and since this is the main purpose of their existence;
If you remove that property its no longer a DIV, it would become a simple inline element and will break the HTML semantics and/or shouldn't be capable of holding other block-level elements anymore.

So instead of making e block-level element behave like inline element, it is better to use a true inline element instead. Other coders are using ready inline-block elements like <li> but that will again break the HTML semantcs and should not be missused also.

So, again the best solution that remains for this type of positioning is using an inline element and add to it, an inline-block display property.

Yes, the soultion I suggested would have to be cross-browser, and since I allready mentioned, css instruction inline-block will not override the native line-break property of the div element in explorer.

Troy III 272 Posting Pro

Hi troyIII,

As you can see, in my sample-code there's an un-paired <div> tag over at line#99. And might be causing a bit of a problem over the document. The script also provides another cross-browser addEvent( param1, param2, param_N ) handler functionality -- that allows you to add events' on a shorter range of call.

You are complaining about 1.51k size, without thinking that it is the overall size of the entire document and not just by the script itself.

A standard valid document would atleast cost you 0.908b for its total file size under Strict markup:

<?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 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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 id="css21" type="text/css" media="screen">
/* <![CDATA[ */

/* ]]> */
</style> 
<script id="javascript1.5" type="text/javascript">
// <![CDATA[

// ]]>
</script>
</head>
<body>

</body>
</html>

- and would you mind showing me some sample code using your script above, if the target is on the <a> and not just from a normal <li> tag execution?

Lets see how long you can hold those lines without repeating the call over the <li> tag and change its background with an <anchor> call...

If i had another <li><a href="#" onmouseover="somefunc();" onmouseover handler inside my anchor, then this will complicate things with the code you have provided.