Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18057

Re: Simple question about div show or hide

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
From Cezary Tomczyk <cezary.tomczyk@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Simple question about div show or hide
Date Thu, 10 Jan 2013 21:02:26 +0100
Organization Aioe.org NNTP Server
Lines 27
Message-ID <kcn6od$pg0$1@speranza.aioe.org> (permalink)
References <b7e6883d-fe02-41ca-b4e8-89cfaccde7f6@googlegroups.com> <kckoce$v6$2@speranza.aioe.org> <kcmrk9$kkb$1@dont-email.me>
NNTP-Posting-Host zYd0PXwpR9QMvAmoEDGsiw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.javascript:18057

Show key headers only | View raw


W dniu 2013-01-10 17:52, Martin Leese pisze:
> Cezary Tomczyk wrote:
>
>> I would write in that way*:
> ...
>> switchView = function(e){
>>     if (b) {
>>         elm.style.display = 'block';
>>     } else {
>>         elm.style.display = 'none';
>>     }
> ...
>>   3) it's better to use 'class' and switch classes instead of inline
>> styles
>
> Why?  Or, more correctly, under what
> conditions is it better?

1. In above example logic ix mixed with presentation, which developer 
should avoid.
2. "Class"-es can contains more styles, not only "display".

+ http://webdesign.about.com/od/css/a/aa073106.htm

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Simple question about div show or hide justaguy <lichunshen84@gmail.com> - 2013-01-09 12:54 -0800
  Re: Simple question about div show or hide Scott Sauyet <scott.sauyet@gmail.com> - 2013-01-09 13:29 -0800
  Re: Simple question about div show or hide Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-01-09 22:44 +0100
    Re: Simple question about div show or hide justaguy <lichunshen84@gmail.com> - 2013-01-09 14:25 -0800
      Re: Simple question about div show or hide Richard Yates <richard@yatesguitar.com> - 2013-01-09 14:47 -0800
    Re: Simple question about div show or hide Martin Leese <please@see.Web.for.e-mail.INVALID> - 2013-01-10 09:52 -0700
      Re: Simple question about div show or hide Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-01-10 21:02 +0100
  Re: Simple question about div show or hide Hans-Georg Michna <hans-georgNoEmailPlease@michna.com> - 2013-01-10 18:26 +0100
    Re: Simple question about div show or hide "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-10 19:37 +0100
  Re: Simple question about div show or hide Danny <dann90038@gmail.com> - 2013-01-10 12:47 -0800

csiph-web