🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #51169

css js toggleVisibility

#51169
From: BooB
Date: Tue, 04 Sep 2012 10:42
20 lines
2012 bytes
są dwa obrazki . jak zrobić aby po kliknięciu drugiego obrazka chował się div przypisany do pierwszego ?? i na odwrót.
na razie to muszę kliknąć aby wpierw schować poprzedni div .


<script type="text/javascript">
function toggleVisibility(me){
if (me.style.visibility=="hidden"){
me.style.visibility="visible";
}else{
me.style.visibility="hidden";
}}</script>

oraz

<div id="wr11" style="position:absolute;width:100px;height:100px; background-color:yellow;left:300px;top:150px;visibility:hidden;"></div>
<div id="wr12" style="position:absolute;width:100px;height:100px; background-color:green;left:300px;top:150px;visibility:hidden;"></div>
<div>
<a class="button" style="background-image:url(foto/szafka1.jpg)" href="#" onclick="toggleVisibility(wr11)"></a>
<a class="button" style="background-image:url(foto/szafka2.jpg)" href="#" onclick="toggleVisibility(wr12)"></a>
</div>
Technical Details
Message-ID: <9a685326-7dbb-4416-acff-ddef531ae8b9@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!news.glorb.com!v8no568646qap.0!news-out.google.com!da15ni61365308qab.0!nntp.google.com!v8no568634qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Received: by 10.224.42.68 with SMTP id r4mr3753083qae.4.1346755373805;        Tue, 04 Sep 2012 03:42:53 -0700 (PDT)
Received: by 10.52.35.104 with SMTP id g8mr2236976vdj.19.1346755373723; Tue, 04 Sep 2012 03:42:53 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!news.glorb.com!v8no568646qap.0!news-out.google.com!da15ni61365308qab.0!nntp.google.com!v8no568634qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.javascript
Date: Tue, 4 Sep 2012 03:42:53 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=88.156.132.194; posting-account=0PweLwoAAAD7u_TEvl7sl1V26gMlfF37
NNTP-Posting-Host: 88.156.132.194
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9a685326-7dbb-4416-acff-ddef531ae8b9@googlegroups.com>
Subject: css js toggleVisibility
From: BooB <max-in@wp.pl>
Injection-Date: Tue, 04 Sep 2012 10:42:53 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit