absolute pos. layer and css inline/and external

S

se

I have a hidden absolute pos. div to popup with some
information. Just to find out that javascript requires me to
have the styles inline.
There must be a way to tell javascript to look for the
styles externally/ or on the parent page.
How does this look like?.
Thanks!
/se
 
G

Gregor Kofler

Am 2010-08-15 07:42, se meinte:
I have a hidden absolute pos. div to popup with some
information. Just to find out that javascript requires me to
have the styles inline. There must be a way to tell javascript to look
for the
styles externally/ or on the parent page.

Huh? What parent page? What inline/external "styles"?
How does this look like?.

Depends.
element.style.display = "none" => element.style.display = ""
element.style.left = "-10000px" => element.style.left = "0px"
element.className = "hidden" => element.className = "shown"
....

Gregor
 
D

Denis McMahon

I have a hidden absolute pos. div to popup with some
information. Just to find out that javascript requires me to
have the styles inline. There must be a way to tell javascript to look
for the
styles externally/ or on the parent page.
How does this look like?.
Thanks!

Please include a link to your page so we can see what you're doing and
maybe work out what's wrong with it.

Rgds

Denis McMahon
 
S

se

Denis McMahon said:
Please include a link to your page so we can see what you're doing and
maybe work out what's wrong with it.

Rgds

Denis McMahon

Nothing wrong with my pages. Like I said, the styles are placed in
the absolute position div-layer, and so it works correctly when
getting a
document.getElementId("nameofdivlayerID").style.visibility="visible";
no problem in that case.
The hidden layer:
<div id="nameofdivlayerID" style="visibility:hidden;
position:absolute; z-index:10; left: 100px; top:50px; ----" >
----------
----------
</div>
I want the styles in a stylesheet or in the document
head. Doing so, the script stop working. -The layer stay hidden.
Having all those styles inline really looks messy.
If you can't do without having me to post my site here, then
stop thinking in my problem. If you've been participating on
newsgroups for couple of years or so, you got to know what happens
with a site posting it's url there. The site is immidiately picked
up by spambots and ends up anywhere. Just like this post here
perhaps ends up on egg-cafe.
Do you think that's raising page-rank having ones url spread around
on places that's not related to the page content of the site.
On the contrary!.
/se
 
G

Gregor Kofler

Am 2010-08-15 20:24, se meinte:
Nothing wrong with my pages. Like I said, the styles are placed in
the absolute position div-layer, and so it works correctly when
getting a
document.getElementId("nameofdivlayerID").style.visibility="visible";
no problem in that case.
The hidden layer:
<div id="nameofdivlayerID" style="visibility:hidden;
position:absolute; z-index:10; left: 100px; top:50px; ----" >
----------
----------
</div>
I want the styles in a stylesheet or in the document
head. Doing so, the script stop working. -The layer stay hidden.
Having all those styles inline really looks messy.
Indeed.

If you can't do without having me to post my site here, then
stop thinking in my problem.

Given your problem description, there's nothing really to think about yet.
If you've been participating on
newsgroups for couple of years or so, you got to know what happens
with a site posting it's url there.

What? I frequently place my webpage in the sig.
The site is immidiately picked
up by spambots and ends up anywhere.

Even worse: It might end up in the *WORLD WIDE WEB*. Seriously, what's
the problem with spambots "picking up" my website or not? Isn't the idea
to make ones webpage as popular as possible (at least most of the time).
Do have to relearn what I know or think to know about the WWW?
Just like this post here perhaps ends up on egg-cafe.

Given the quality of your post - good that you chose a nym.
Do you think that's raising page-rank having ones url spread around
on places that's not related to the page content of the site.
On the contrary!.

I have read this above sentence several times - it still eludes me, what
you wanted to say.

Gregor (note: that's my real name, and the website below is a real URI,
and the domain is owned by me, and I don't give a damn, where it ends up)
 
S

se

Gregor Kofler said:
Am 2010-08-15 20:24, se meinte:


Given your problem description, there's nothing really to think about yet.


What? I frequently place my webpage in the sig.


Even worse: It might end up in the *WORLD WIDE WEB*. Seriously, what's the
problem with spambots "picking up" my website or not? Isn't the idea to
make ones webpage as popular as possible (at least most of the time). Do
have to relearn what I know or think to know about the WWW?


Given the quality of your post - good that you chose a nym.


I have read this above sentence several times - it still eludes me, what
you wanted to say.

Gregor (note: that's my real name, and the website below is a real URI,
and the domain is owned by me, and I don't give a damn, where it ends up)

You're right, I ended up on *WORLD WIDE WEB*. but with yours.
Here's the result testing your page. This test possibly explains why
we get no answers here other than *objections*
Refereing also to the "me" thread about a dozen of lines from this post;
I agree with:
(This "how do I ?", "You don't." pattern in newsgroups is getting tiring;
if you want to help someone, help them; if you just want to express your
disdain for other people, start a blog or something.)

Here's the test of yours. You stated above "don't care"
Does this eludes you:

W3C CSS Validator results for http://vxjs.gregorkofler.com/ (CSS level 2.1)
Sorry! We found the following errors (26)
 
G

Gregor Kofler

Am 2010-08-15 23:35, se meinte:
You're right, I ended up on *WORLD WIDE WEB*. but with yours.
Here's the result testing your page. This test possibly explains why
we get no answers here other than *objections*
Refereing also to the "me" thread about a dozen of lines from this post;
I agree with:

This is usenet, not a helpdesk. (And with your problem "description" a
psychic might come in handy.)
Marc.

Here's the test of yours. You stated above "don't care"
Does this eludes you:

Elude me what?
W3C CSS Validator results for http://vxjs.gregorkofler.com/ (CSS level 2.1)
Sorry! We found the following errors (26)

And your point is? That my CSS sports level 2.1 errors? Indeed, since
these are CSS3 and/or proprietary properties like opacity or rgba()
values. It "degrades gracefully" - IE users have to live without rounded
corners.

Gregor
 
S

se

Problem solved.
I had a syntax error. I wrote this:

if (thisdoc.style.visibility=="hidden")
{ thisdoc.style.visibility="visible";}

Should be:

if (thisdoc.style.visibility="hidden")
{ thisdoc.style.visibility="visible";}

/se
 
R

rf

se said:
Problem solved.
I had a syntax error. I wrote this:

if (thisdoc.style.visibility=="hidden")
{ thisdoc.style.visibility="visible";}

Should be:

if (thisdoc.style.visibility="hidden")
{ thisdoc.style.visibility="visible";}

No, it probably should not. I think you are grasping at straws.

Why would you want an *assignment* inside that if statement? Surely a
logical comparison is more advisable.
 
G

Gregor Kofler

Am 2010-08-16 00:44, se meinte:
Problem solved.
I had a syntax error. I wrote this:

if (thisdoc.style.visibility=="hidden")
{ thisdoc.style.visibility="visible";}

Should be:

if (thisdoc.style.visibility="hidden")
{ thisdoc.style.visibility="visible";}

Definitely not. In the latter case the condition always evaluates to
true, and visibility will always be set to visible.
(You have not the slightest clue of JS, have you?)

Gregor
 
S

se

Gregor Kofler said:
Am 2010-08-16 00:44, se meinte:

Definitely not. In the latter case the condition always evaluates to true,
and visibility will always be set to visible.
(You have not the slightest clue of JS, have you?)

Gregor

Why do you think people's asking for help here. Ask yourself too?.
In this case, anyway, I accidentedly changed the two. Look at
the same I posted above. Here the "if" clause uses the double equal
sign.
The code below here is working perfectly as long as all the styles
are in the container div on the hidden layer. Transfering those styles
to the document head, it stops working.
If you don't have anything useable to say, Gregor, then piss off.
And get you site to validate. There's other easy methodes for
making round corners. Do you have trouble using graphics?.
Until browsers can handle css3 stick to the old method.
TwentySix validation errors is far too much. And is not even
gracefull in itself.

var thisdoc;
var cooLX;
document.onmouseup = mouseup;
function Dragg(e){
if (e == null) { e = window.event;}
var tar = (typeof( window.event ) != "undefined" ) ? e.srcElement :
e.target;
if (tar.id=="titlebar")
{
mouseover=true;
curX=parseInt(thisdoc.style.left);
curY=parseInt(thisdoc.style.top);
offsetx=e.clientX;
offsety=e.clientY;
document.onmousemove=drg;
return false;
}
else { return false; }
}
function drg(e){
if (e == null) { e = window.event;}
var coorl=curX+e.clientX-offsetx;
var coort=curY+e.clientY-offsety;
if (coorl<0){coorl=0;}
if (coort<0) {coort=0;}
thisdoc.style.left = coorl + "px";
thisdoc.style.top = coort + "px";
return false;
}
function mouseup(e)
{
document.onmousemove=null;
}
function HideLayer(){
if (thisdoc.style.visibility == "visible")
{
thisdoc.style.visibility = "hidden";
}}
function ShowLayer(){
thisdoc=document.getElementById("layer10");
if (thisdoc.style.visibility == "hidden")
{
thisdoc.style.position = "fixed";
thisdoc.style.visibility = "visible";
thisdoc.style.left = 30 + "px";
thisdoc.style.top = 125 + "px";
}}

/se
 
G

Gregor Kofler

Am 2010-08-16 15:22, schrieb se:
Why do you think people's asking for help here. Ask yourself too?.
In this case, anyway, I accidentedly changed the two. Look at
the same I posted above. Here the "if" clause uses the double equal
sign.

You don't make sense. You stated, that your "=="-solution was wrong and
the correct one was the "-"-version, which it can't be.
The code below here is working perfectly as long as all the styles
are in the container div on the hidden layer. Transfering those styles
to the document head, it stops working.
If you don't have anything useable to say, Gregor, then piss off.

Such harsh words. If you can't form a proper question and confuse usenet
with helpdesks and don't like the answers, why do you hang out here?
And get you site to validate.

Why? To make you happy? Validators are nice things - if you can
interpret their results, which you obviously can't. BTW there is JSLint
- http://www.jslint.com Have you ever tried to your scripts on it? Now
*this* can be helpful.
There's other easy methodes for
making round corners. Do you have trouble using graphics?.

Indeed. Too much work - and in the case of round corners too little payoff.
Until browsers can handle css3 stick to the old method.

Why? The others get angled corners. They never gonna miss the round
ones, since they don't know that they could be there.
TwentySix validation errors is far too much.

While you are on your crusade: You like to point out the validation
errors on the webpages of all those "major players" to them. 484 errors
on amazon.com is really really far too much. Really. And That's just the
markup. The CSS' have another 35 errors and 266 warnings...
And is not even
gracefull in itself.

"Gracefull(sic!) in itself" - what's that supposed to mean? You know the
concept of graceful degradation?


Some indentation would help. It's really hard to see (and understand)
what this piece of code is supposed to do.
var thisdoc;
var cooLX;
document.onmouseup = mouseup;
function Dragg(e){
if (e == null) { e = window.event;}

if(e) { ... } suffices.
var tar = (typeof( window.event ) != "undefined" ) ? e.srcElement :
e.target;

var tar = e.srcElement || e.target;

No need for inference.
if (tar.id=="titlebar")
{
mouseover=true;
curX=parseInt(thisdoc.style.left);
curY=parseInt(thisdoc.style.top);
offsetx=e.clientX;
offsety=e.clientY;

No more "var" keywords?
document.onmousemove=drg;
return false;
}
else { return false; }
}
function drg(e){
if (e == null) { e = window.event;}

See above.
var coorl=curX+e.clientX-offsetx;
var coort=curY+e.clientY-offsety;
if (coorl<0){coorl=0;}
if (coort<0) {coort=0;}
thisdoc.style.left = coorl + "px";
thisdoc.style.top = coort + "px";
return false;
}
function mouseup(e)
{
document.onmousemove=null;
}
function HideLayer(){
if (thisdoc.style.visibility == "visible")
{
thisdoc.style.visibility = "hidden";
}}
function ShowLayer(){
thisdoc=document.getElementById("layer10");

Better: Establish the reference once.
if (thisdoc.style.visibility == "hidden")
{
thisdoc.style.position = "fixed";

Why "fixed"?
thisdoc.style.visibility = "visible";
thisdoc.style.left = 30 + "px";
thisdoc.style.top = 125 + "px";

Why not just "30px" and "125px"?

Better use a reference of the style object: var s = thisdoc.style;
s.position = ...;
s.left = ...;

I miss a "mousedown" listener - without that, everything is guesswork.

Gregor
 
S

se

Your postings looks obdurate. The same is true for a couple of the
other regulars, who showed up without anything useable to give.
Several times you've been answering me and others here without
anything else but criticism. You're wasting our time. Lots of threads
here to prove it. You don't know what's the definition of idjits.

Adventually, my code runs fine in all major browsers with the styles
inline. At some day, I'll google a solution of having it running with
the styles "out of inline". It has nothing to do with a mousedown
listener. Are you a newbie?.

What a couple of ar**s here.
 
G

Gregor Kofler

Am 2010-08-16 18:36, se meinte:
Your postings looks obdurate. The same is true for a couple of the

Obdurate - nice word...
other regulars, who showed up without anything useable to give.

Understandable, since you never formed a proper (I don't dare to say
"smart") question, and lack the competence to understand the answers
trying to be helpful.
Several times you've been answering me and others here without anything
else but criticism.

Others - raise yer hands.
You're wasting our time.

Majestic plural!? I would have formulated my answers differently, if I
had known before.
Lots of threads
here to prove it. You don't know what's the definition of idjits.

Idjits? Is this a synonym for "usenet dumbfucks from Denmark"?
Adventually, my code runs fine in all major browsers with the styles
inline. At some day, I'll google a solution of having it running with
the styles "out of inline". It has nothing to do with a mousedown
listener.

Oh, I'm pretty sure that it has nothing to do with a mousedown listener.
Actually my code runs fine without inline styles. It has nothing to do
with my mousedown listeners, either.
Are you a newbie?.

Relatively speaking: Yes, could be. There are quite a few people out
there, who know more about browser scripting than I do. Idjits from
Denmark are not among them.
What a couple of ar**s here.

I can only see one.
 
S

se

Gregor Kofler said:
Am 2010-08-16 18:36, se meinte:

Idjits? Is this a synonym for "usenet dumbfucks from Denmark"?



No man having an IQ from normal and up would
interfere a country into disdain because of an
internal usenet discussion between a couple of men.

You've proved yourself to be an idjit. Period!.

/se
 
S

se

There's nothing wrong, whatsoever, with using CSS3 for non-critical
enhancements to web pages, and of course those rules will fail 2.1
validation. So what?

The browsers that don't understand the rules do nothing, the other
browsers present a nicer looking page with very little overhead.

The non-semantic overhead with using graphics for rounded corners on
boxes that expand both horizontally and vertically is extreme. Many
designers use 4 nested divs or else insert extra divs into the DOM using
a script (inaccessible).

Furthermore, many leading CSS experts and designers who with excellent
track records working for web accessibility advocate using CSS3 *now* to
enhance web pages.

Different opinions existes on matters.
One thing;
When a webdesigner claims his pages for validating.
Others working in the field tend to see him as a hillbilly when
finding his pages not validating. He states on he's site, he's pages
validates. Like I said, found 26 validating errors on this site:
http://vxjs.gregorkofler.com
Read his claiming below. I knows he's a smart-ass. And he
proved it, calling names over a whole country. And he give no
help here. And play the wise-guy role.
Read he's claims below:

http://photo.gregorkofler.com/index.php?page=about

The website relies on state-of-the-art web technology
without pushing it. CSS and lean markup is used for
good measure (yupp - no table-layouts), the applets
for crossfading slides are nice but no necessity,
so is most of the JavaScript, no pop-ups, no
proprietary solutions; instead validating
pages and a scalable layout
(unless you prefer absurd font sizes)
 
S

se

williamc said:
Disagree. Everything on that very nicely designed site is valid CSS.
Yes, it does not validate as CSS 2.1, but that's more of a limitation in
the validator.

As long as you provide the valid CSS 2.1 rules when necessary, there's
no harm in overriding them with CSS 3 rules (e.g. use an rgba color to
override a a CSS 2.1 color specification). And IMO there's nothing wrong
with using CSS3 enhancements like text-shadow, box-shadow. rgba color
etc. When it comes to something like CSS transitions, your case is much
stronger.

But, as I mentioned before very capable web designers and standards
advocates such as Andy Clarke, Dan Cedarholm and Jeff Zeldman recommend
that you start using CSS 3 now. It's up to you to decide, but I don't
think people are going to see early adopters as know-nothings if they
judiciously use CSS 3.


Well, this might not be the most polite group in the world. but there
are many people here who can give you good guidance about how to use
Javascript.

In the faq it says "Avoid being unnecessarily rude, but do not complain
about other rude posts." That's good advice, if generally ignored. :)


Well, somebody would argue below being a limitation in browser
performance.
Yes, it does not validate as CSS 2.1, but that's more of a limitation in
the validator.

Anyway, lack of validation of websites is not limited to sites using
css3. The majority of websites does not validate. And has not ever
done this. I believe in the value of having pages to fully validate.
As a way of easier controlling rendering.
Don't know much about advanced webdesign. I'm new in web -and
to javascript too. But had my 18 website pages to validate. As I find
out the value of this by working the nights over on it. I also can see via
my sites stat and google too, expenses being participating on
newsgroup posting ones site here. My site informs a group of people
with usefull information. Care must be taken against spoiling it by
posting it all over for the spambots. These spambots operates
continuously here. The ones persons whom sites is made for their
own pleasure of show off, should learn to show less.
I accept peoples way looking at things, as long as they accept mine.
But no longer than to then.
/se
 
T

Thomas 'PointedEars' Lahn

Gregor said:
element.style.left = "-10000px" => element.style.left = "0px"

Please don't post examples like this. The uninitiated could get the idea
that this would be appropriate in order to show/hide an element (and even
people who should know better are doing this kind of nonsense).

Negative lengths are *implementation-dependent* *in* *CSS* to begin with:

<http://www.w3.org/TR/CSS2/syndata.html#length-units>


PointedEars
 
S

se

Thomas 'PointedEars' Lahn said:
Please don't post examples like this. The uninitiated could get the idea
that this would be appropriate in order to show/hide an element (and even
people who should know better are doing this kind of nonsense).

Negative lengths are *implementation-dependent* *in* *CSS* to begin with:

<http://www.w3.org/TR/CSS2/syndata.html#length-units>


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <[email protected]>

I think some truth in the lines of Richard Comford.
The bugs I had, I found it. this one:
if (document.getElementById("layer10").style.visibility=="hidden")
doesn't work in any of the major browsers, with the css-style "layer10"
placed in the head of the document, whereas it works having this style
inline. I don't see any other reason than the designers of javascript
didn't knew javascript.
/se
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top