Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
rob::digitalburn #1
vertical positioning
Hi,
Does anyone have a (relatively) reliable method of positioning a
positionable element in the vertical centre (or other proportion) of a
window, in a (relatively) cross browser compatible fashion, and without
using any stiiiiiiiiinking tables? I'm thinking IE, Moz, Safari, any others
a bonus. I know it's easy to do in IE and Netscrape... the central issue is
just finding the window's height I guess.
cheers
Rob
rob::digitalburn Guest
-
About positioning text
Hi, i dont really know how to use the text in DreamWeaver. I know you can align it right,left etc.. But OMG cant you put it wherever you want??I... -
Vertical Positioning of Site
Ok, I am stumped! I am a new developer, and I cannot seem to make my sites align vertically to the top of the window. I have tried this many times,... -
positioning
im trying to move a div tag to the right side, ive tried using "float" but it doesnt work the way i want it to. i tried setting its position as... -
CSS Div Positioning
Anybody know how to cause a DIV to be aligned to the bottom of the page? If you go to: http://www.tilaru.com/NewSite/index.php you'll see that my... -
positioning loadmovie
hello, on level 0 : a button executing : loadmovie("1.JPEG",1) ( loaded to level 1 ) I would like to give a position (x,y) to this... -
The ScareCrow #2
Re: vertical positioning
The attached code should help.
The hard part is determining what the width and height of the element is.
This needs to be set for the JS to read it.
Ken
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
function valign(){
var winW = 630, winH = 460;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
w = (winW/2) - (parseInt(document.getElementById('myDiv').style.w idth)/2);
h = (winH/2) - (parseInt(document.getElementById('myDiv').style.h eight)/2);
document.getElementById('myDiv').style.left = w;
document.getElementById('myDiv').style.top = h;
}
//-->
</script>
</head>
<body onload="valign();">
<div align="center" id="myDiv" style="border: thin solid Black; left: 200px;
top: 50px; width: 300px; height: 50px; position: absolute;">
This is the div..............
</div>
</body>
</html>
The ScareCrow Guest
-
rob::digitalburn #3
Re: vertical positioning
Thanks. Knowing the height of the element being positioned is no problem,
that's set already. Will this script work with things such as Moz and Safari
though? Just looks as if it does IE and Netscrape to me...? Or am I missing
something?
The ScareCrow wrote:> The attached code should help.
>
> The hard part is determining what the width and height of the
> element is. This needs to be set for the JS to read it.
>
>
> Ken
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
> <head>
> <title>Untitled</title>
> <script language="JavaScript">
> <!--
> function valign(){
> var winW = 630, winH = 460;
> if (parseInt(navigator.appVersion)>3) {
> if (navigator.appName=="Netscape") {
> winW = window.innerWidth;
> winH = window.innerHeight;
> }
> if (navigator.appName.indexOf("Microsoft")!=-1) {
> winW = document.body.offsetWidth;
> winH = document.body.offsetHeight;
> }
> }
> w = (winW/2) -
> (parseInt(document.getElementById('myDiv').style.w idth)/2); h =
> (winH/2) -
> (parseInt(document.getElementById('myDiv').style.h eight)/2);
> document.getElementById('myDiv').style.left = w;
> document.getElementById('myDiv').style.top = h; } //-->
> </script>
> </head>
>
> <body onload="valign();">
> <div align="center" id="myDiv" style="border: thin solid Black;
> left: 200px; top: 50px; width: 300px; height: 50px; position:
> absolute;"> This is the div..............
> </div>
>
>
> </body>
> </html>
rob::digitalburn Guest
-
The ScareCrow #4
Re: vertical positioning
I don't code for all these browsers, so I forget to allow for them. But I have
found this code that should suffice for you
if (self.innerHeight){
// all except Explorer
winW = window.innerWidth;
winH = window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight){
// Explorer 6 Strict Mode
winW = document.documentElement.clientWidth;
winH = document.documentElement.clientHeight;
}
else if (document.body){
// other Explorers
winW = document.body.clientWidth;
winH = document.body.clientHeight;
}
var test1 = document.body.scrollHeight;
var test2 = document.body.offsetHeight;
if (test1 > test2){
// all but Explorer Mac
winW = document.body.scrollWidth;
winH = document.body.scrollHeight;
}
else{
// Explorer Mac - would also work in Explorer 6 Strict, Mozilla and Safari
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
Ken
The ScareCrow Guest
-
rob::digitalburn #5
Re: vertical positioning
Okay, I'll check it out. More people are using Moz than Netscrape these days
(and the percentage is increasing rapidly), so it's worth coding for. Plus
if your code's compatible with Moz, it should be compatible with just about
anything as it has decent standards support :)
In fact, I heard that Moz downloads have gone from 10,000/week to
200,000/week (or was that day, can't remember?) since the W3C stated that it
thought that the security problems with IE were inherently unfixable.
The ScareCrow wrote:> I don't code for all these browsers, so I forget to allow for them.
> But I have found this code that should suffice for you
>
> if (self.innerHeight){
> // all except Explorer
> winW = window.innerWidth;
> winH = window.innerHeight;
> }
> else if (document.documentElement &&
> document.documentElement.clientHeight){ // Explorer 6 Strict Mode
> winW = document.documentElement.clientWidth;
> winH = document.documentElement.clientHeight;
> }
> else if (document.body){
> // other Explorers
> winW = document.body.clientWidth;
> winH = document.body.clientHeight;
> }
> var test1 = document.body.scrollHeight;
> var test2 = document.body.offsetHeight;
> if (test1 > test2){
> // all but Explorer Mac
> winW = document.body.scrollWidth;
> winH = document.body.scrollHeight;
> }
> else{
> // Explorer Mac - would also work in Explorer 6 Strict, Mozilla and
> Safari winW = document.body.offsetWidth;
> winH = document.body.offsetHeight;
> }
>
>
> Ken
rob::digitalburn Guest
-
Tron #6
Re: vertical positioning
rob::digitalburn wrote:
Well, there were 2 million copies downloaded in the space of ten days a> Okay, I'll check it out. More people are using Moz than Netscrape these days
> (and the percentage is increasing rapidly), so it's worth coding for. Plus
> if your code's compatible with Moz, it should be compatible with just about
> anything as it has decent standards support :)
>
> In fact, I heard that Moz downloads have gone from 10,000/week to
> 200,000/week (or was that day, can't remember?) since the W3C stated that it
> thought that the security problems with IE were inherently unfixable.
while back. And people who are using it are really pushing it as the
only valid alt to IE...at least, in Windows. I still prefer to use
Safari on my Mac, but it handles stuff mostly the same as Mozilla.
My biggest reason for using Safari over FF? FF doesn't have a little
button you can click on to close a tab, and Safari does. It's the little
things.
Tron Guest
-
Murray *TMM* #7
Re: vertical positioning
> (and the percentage is increasing rapidly)
-----------------------------------^^^^^^^^^^^^^^^^^
Poetic license? I'd say the percentage among the general surfing populace
is increasing glacially.
You got a reference for this?> In fact, I heard that Moz downloads have gone from 10,000/week to
> 200,000/week (or was that day, can't remember?) since the W3C stated that
> it
> thought that the security problems with IE were inherently unfixable.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rob::digitalburn" <rob@digitalburn.net> wrote in message
news:cl25ht$368$1@forums.macromedia.com...> Okay, I'll check it out. More people are using Moz than Netscrape these
> days
> (and the percentage is increasing rapidly), so it's worth coding for. Plus
> if your code's compatible with Moz, it should be compatible with just
> about
> anything as it has decent standards support :)
>
> In fact, I heard that Moz downloads have gone from 10,000/week to
> 200,000/week (or was that day, can't remember?) since the W3C stated that
> it
> thought that the security problems with IE were inherently unfixable.
>
>
Murray *TMM* Guest
-
rob::digitalburn #8
Re: vertical positioning
[url]http://news.com.com/Firefox+drawing+fans+away+from+Microsoft+IE/2100-1032_3-5368302.html?tag=st.rn[/url]
This link has some facts and figures.
"The percentage of visitors to e-commerce and corporate sites that used
Firefox or another Mozilla browser grew to 5.2 percent in September, from
3.5 percent in June 2004."
That's a fairly big jump... I'm sure you can find more info. What's the
matter anyway Murray, feeling a bit threatened be change are we? :)
Murray *TMM* wrote:>>> (and the percentage is increasing rapidly)
>> -----------------------------------^^^^^^^^^^^^^^^^^
> Poetic license? I'd say the percentage among the general surfing
> populace is increasing glacially.
>>>> In fact, I heard that Moz downloads have gone from 10,000/week to
>> 200,000/week (or was that day, can't remember?) since the W3C stated
>> that it
>> thought that the security problems with IE were inherently unfixable.
> You got a reference for this?
>
>
> "rob::digitalburn" <rob@digitalburn.net> wrote in message
> news:cl25ht$368$1@forums.macromedia.com...>> Okay, I'll check it out. More people are using Moz than Netscrape
>> these days
>> (and the percentage is increasing rapidly), so it's worth coding
>> for. Plus if your code's compatible with Moz, it should be
>> compatible with just about
>> anything as it has decent standards support :)
>>
>> In fact, I heard that Moz downloads have gone from 10,000/week to
>> 200,000/week (or was that day, can't remember?) since the W3C stated
>> that it
>> thought that the security problems with IE were inherently unfixable.
rob::digitalburn Guest
-
rob::digitalburn #9
Re: vertical positioning
Exactly, attention to detail :)
> My biggest reason for using Safari over FF? FF doesn't have a little
> button you can click on to close a tab, and Safari does. It's the
> little things.
rob::digitalburn Guest
-
Murray *TMM* #10
Re: vertical positioning
> feeling a bit threatened be change are we? :)
Not at all. I actually use and prefer FF myself, but I just wanted to
separate fact from fiction.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"rob::digitalburn" <rob@digitalburn.net> wrote in message
news:cl74vr$n94$1@forums.macromedia.com...> [url]http://news.com.com/Firefox+drawing+fans+away+from+Microsoft+IE/2100-1032_3-5368302.html?tag=st.rn[/url]
>
> This link has some facts and figures.
>
> "The percentage of visitors to e-commerce and corporate sites that used
> Firefox or another Mozilla browser grew to 5.2 percent in September, from
> 3.5 percent in June 2004."
>
> That's a fairly big jump... I'm sure you can find more info. What's the
> matter anyway Murray, feeling a bit threatened be change are we? :)
>
>
>
> Murray *TMM* wrote:>>>>>> (and the percentage is increasing rapidly)
>>> -----------------------------------^^^^^^^^^^^^^^^^^
>> Poetic license? I'd say the percentage among the general surfing
>> populace is increasing glacially.
>>>>>>> In fact, I heard that Moz downloads have gone from 10,000/week to
>>> 200,000/week (or was that day, can't remember?) since the W3C stated
>>> that it
>>> thought that the security problems with IE were inherently unfixable.
>> You got a reference for this?
>>
>>
>> "rob::digitalburn" <rob@digitalburn.net> wrote in message
>> news:cl25ht$368$1@forums.macromedia.com...>>> Okay, I'll check it out. More people are using Moz than Netscrape
>>> these days
>>> (and the percentage is increasing rapidly), so it's worth coding
>>> for. Plus if your code's compatible with Moz, it should be
>>> compatible with just about
>>> anything as it has decent standards support :)
>>>
>>> In fact, I heard that Moz downloads have gone from 10,000/week to
>>> 200,000/week (or was that day, can't remember?) since the W3C stated
>>> that it
>>> thought that the security problems with IE were inherently unfixable.
>
Murray *TMM* Guest
-
bsnyder2004 #11
Re: vertical positioning
Originally posted by: I don't know what version of firefox you are using, but
with mine I have a little button to close the tabs and I got a cool extension
which allows me to just double click the open tab to close it. I like that way
better than the safari setup. <br> <br> Just my preference :-D
Chill Newsgroup User rob::digitalburn wrote:<BR>> Okay, I'll check it
out. More people are using Moz than Netscrape these days<BR>> (and the
percentage is increasing rapidly), so it's worth coding for. Plus<BR>>
if your code's compatible with Moz, it should be compatible with just
about<BR>> anything as it has decent standards support
:)<BR>> <BR>> In fact, I heard that Moz downloads have gone
from 10,000/week to<BR>> 200,000/week (or was that day, can't
remember?) since the W3C stated that it<BR>> thought that the security
problems with IE were inherently unfixable.<BR><BR>Well, there were
2 million copies downloaded in the space of ten days a <BR>while back.
And people who are using it are really pushing it as the <BR>only valid
alt to IE...at least, in Windows. I still prefer to use <BR>Safari on my
Mac, but it handles stuff mostly the same as Mozilla.<BR><BR>My
biggest reason for using Safari over FF? FF doesn't have a little
<BR>button you can click on to close a tab, and Safari does. It's the
little <BR>things.<BR>
bsnyder2004 Guest



Reply With Quote

