Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Div - visible tag (http://www.velocityreviews.com/forums/t161118-div-visible-tag.html)

tshad 03-01-2005 10:55 PM

Div - visible tag
 
I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

If so how do you control areas of html visibility? This does seem to work,
however.

Thanks,

Tom



Barbara de Zoete 03-01-2005 11:02 PM

Re: Div - visible tag
 
On Tue, 01 Mar 2005 22:55:08 GMT, tshad <tscheiderich@ftsolutions.com> wrote:

> I was told you could use <div id=sectionName visible=false> to control
> visibility of sections of html on the screen.
>
> But DW says:
>
> The visible attribute of the DIV tag is not supported. [Microsoft Internet
> Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
> 6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]
>
> Is this true?
>
> If so how do you control areas of html visibility? This does seem to work,
> however.
>


Start reading instead of the tons of questions you keep asking:
<http://www.w3.org/TR/2002/WD-CSS21-20020802/cover.html>
We're not your personal helpdesk, you know.

Specific to this question would be:
<http://www.w3.org/TR/2002/WD-CSS21-20020802/visuren.html#display-prop>


--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'

Steve Pugh 03-01-2005 11:08 PM

Re: Div - visible tag
 
"tshad" <tscheiderich@ftsolutions.com> wrote:

>I was told you could use <div id=sectionName visible=false> to control
>visibility of sections of html on the screen.


Whoever told you that was very mistaken. Or you didn't understand what
you were being told.

>But DW says:
>
>The visible attribute of the DIV tag is not supported. [Microsoft Internet
>Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
>6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]
>
>Is this true?


Yes. There is no such attribute. Check the HTML spec if in doubt.

>If so how do you control areas of html visibility?


With CSS. visibility: hidden;

> This does seem to work, however.


Really? In which browsers?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>

tshad 04-16-2005 04:43 AM

Re: Div - visible tag
 

"Steve Pugh" <steve@pugh.net> wrote in message
news:6bt921dgp5nfa0itspjc2i5q1f78fej40o@4ax.com...
> "tshad" <tscheiderich@ftsolutions.com> wrote:
>
> >I was told you could use <div id=sectionName visible=false> to control
> >visibility of sections of html on the screen.

>
> Whoever told you that was very mistaken. Or you didn't understand what
> you were being told.
>
> >But DW says:
> >
> >The visible attribute of the DIV tag is not supported. [Microsoft

Internet
> >Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet

Explorer
> >6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]
> >
> >Is this true?

>
> Yes. There is no such attribute. Check the HTML spec if in doubt.
>
> >If so how do you control areas of html visibility?

>
> With CSS. visibility: hidden;
>
> > This does seem to work, however.

>
> Really? In which browsers?


Mozilla 1.75, IE 6 for a couple.

I have an asp.net page where I have about 6 <div>'s, such as <div id="x"
visible=true runat="server">, that seem to work fine.

It works fine whether traditional or strict.

Tom
>
> Steve
>
> --
> "My theories appal you, my heresies outrage you,
> I never answer letters and you don't like my tie." - The Doctor
>
> Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>




tshad 04-16-2005 05:27 AM

Re: Div - visible tag
 

"Barbara de Zoete" <b_de_zoete@hotmail.com> wrote in message
news:opsmzea5etx5vgts@zoete_b...
> On Tue, 01 Mar 2005 22:55:08 GMT, tshad <tscheiderich@ftsolutions.com>

wrote:
>
> > I was told you could use <div id=sectionName visible=false> to control
> > visibility of sections of html on the screen.
> >
> > But DW says:
> >
> > The visible attribute of the DIV tag is not supported. [Microsoft

Internet
> > Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet

Explorer
> > 6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]
> >
> > Is this true?
> >
> > If so how do you control areas of html visibility? This does seem to

work,
> > however.
> >

>
> Start reading instead of the tons of questions you keep asking:
> <http://www.w3.org/TR/2002/WD-CSS21-20020802/cover.html>
> We're not your personal helpdesk, you know.


If you don't want to answer, then don't.

>
> Specific to this question would be:
> <http://www.w3.org/TR/2002/WD-CSS21-20020802/visuren.html#display-prop>
>

This page didn't tell me what I was looking for.

I did find out how it's done.

It is done using styles (visibility:hidden). But this still wouldn't be
what I was looking for.

I did make a mistake and forgot to add the runat=server to my example
(asp.net):

<div id=sectionName visible=false runat=server>

instead of

<div id=sectionName visible=false>

Apparently, what happens (at least I think that is what happens based on the
html that is produced), asp.net will actually not display the html between
the <div></div> tags if visible is false.

When you add runat=server to the tag, it becomes an html control (an
htmlgenericcontrol to be precise) and html controls have visible attributes.

Thanks,

Tom

>
> --
> ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
> | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
> | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
> |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
> `-------------------------------------------------- --<--@ ------------'




Steve Pugh 04-16-2005 10:31 AM

Re: Div - visible tag
 
"tshad" <tfs@dslextreme.com> wrote:
>"Steve Pugh" <steve@pugh.net> wrote:
>> "tshad" <tscheiderich@ftsolutions.com> wrote:
>>
>> >I was told you could use <div id=sectionName visible=false> to control
>> >visibility of sections of html on the screen.

>>
>> Whoever told you that was very mistaken. Or you didn't understand what
>> you were being told.
>>
>> > This does seem to work, however.

>>
>> Really? In which browsers?

>
>Mozilla 1.75, IE 6 for a couple.


Post the URL so we can check for ourselves.

My test is at http://steve.pugh.net/test/test91.html
and it shows that no browser I have does anything with the visible
attribute.

>I have an asp.net page where I have about 6 <div>'s, such as <div id="x"
>visible=true runat="server">, that seem to work fine.


But is the visible="true" in the code sent to the browser or is it an
instruction to the asp.net parser on the server to do something? The
runar="server" hints at the latter, in which case the whole discussion
is moot. ASP code is not part of HTML and should not be in the final
code that is sent to the browser/validator/whatever.

>It works fine whether traditional or strict.


Of course it does. Neither browsers nor ASP.net servers care much
about the version of HTML being used, especially when it comes to made
up attributes.

>> --
>> "My theories appal you, my heresies outrage you,
>> I never answer letters and you don't like my tie." - The Doctor
>>
>> Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>


I realise that you probably enjoy the wit and wisdom contained in my
sigs, but there's really no need to quote them. In fact a decent
newsreader would have trimmed them from your reply automatically.

Steve

--
"Grab reality by the balls and squeeze." - Tempus Thales

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>

tshad 04-18-2005 02:43 AM

Re: Div - visible tag
 

"Steve Pugh" <steve@pugh.net> wrote in message
news:utp161ppprc1puhs2sl6d5vdecs622qeb7@4ax.com...
> "tshad" <tfs@dslextreme.com> wrote:
> >"Steve Pugh" <steve@pugh.net> wrote:
> >> "tshad" <tscheiderich@ftsolutions.com> wrote:
> >>
> >> >I was told you could use <div id=sectionName visible=false> to control
> >> >visibility of sections of html on the screen.
> >>
> >> Whoever told you that was very mistaken. Or you didn't understand what
> >> you were being told.
> >>
> >> > This does seem to work, however.
> >>
> >> Really? In which browsers?

> >
> >Mozilla 1.75, IE 6 for a couple.

>
> Post the URL so we can check for ourselves.


I just figured out what is happening and when you can use visible for div
tags. There are really 2 situations. You can use <div> to hide and unhide
code. In normal html (non-asp.net) you use the style=visibility:hidden.
This can be changed programatically in Javascript.

In asp.net, you do use the visible attribute. But this is not rendered to
html.

Apparently, what happens (at least I think that is what happens based on the
html that is produced), asp.net will actually not display the html between
the <div></div> tags if visible is false.

When you add runat=server to the tag, it becomes an html control (an
htmlgenericcontrol to be precise) and html controls have visible attributes.

When the page is posted back to the server, you can change the visible
attribute at that time and it will render the code between the div tags if
set to true and won't if set to false.

I assume I can also do the Javascript option I mentioned earlier if I don't
want it to post back to the server.

>
> My test is at http://steve.pugh.net/test/test91.html
> and it shows that no browser I have does anything with the visible
> attribute.
>
> >I have an asp.net page where I have about 6 <div>'s, such as <div id="x"
> >visible=true runat="server">, that seem to work fine.

>
> But is the visible="true" in the code sent to the browser or is it an
> instruction to the asp.net parser on the server to do something? The
> runar="server" hints at the latter, in which case the whole discussion
> is moot. ASP code is not part of HTML and should not be in the final
> code that is sent to the browser/validator/whatever.


You are right (as I mention above).

Thanks,

Tom
>
> >It works fine whether traditional or strict.

>
> Of course it does. Neither browsers nor ASP.net servers care much
> about the version of HTML being used, especially when it comes to made
> up attributes.
>
> >> --
> >> "My theories appal you, my heresies outrage you,
> >> I never answer letters and you don't like my tie." - The Doctor
> >>
> >> Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>

>
> I realise that you probably enjoy the wit and wisdom contained in my
> sigs, but there's really no need to quote them. In fact a decent
> newsreader would have trimmed them from your reply automatically.
>
> Steve
>
> --
> "Grab reality by the balls and squeeze." - Tempus Thales
>
> Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>




Shiggity 02-26-2008 09:39 PM

Quote:

Originally Posted by Steve Pugh
But is the visible="true" in the code sent to the browser or is it an
instruction to the asp.net parser on the server to do something? The
runat="server" hints at the latter

This is correct, when you add runat="server" in an asp.net application, you are creating a server tag from the div, and is handled differently than an html tag rendered by your browser.

You do have to use CSS, as in visibility:hidden and visibility:visible and in JavaScript document.getElementById("thediv").style.visibility ="visible" (not document.getElementById("thediv").style="visibilit y:visible").

No need to be so rude, though. All you accomplish by making smarmy comments is alienate users, incite petty argument, and distract from the topic at hand. If you get some catharsis from sniping at people asking for help, restrict it to a personal blog instead.


All times are GMT. The time now is 09:31 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.