/    Sign up×
Community /Pin to ProfileBookmark

JQuery show-hide issue/thoughts

Hi,

What I want:
A few links (listed items or something like that) trigger visibilty of textfields.
Position of the textfields is always the same (so that’s css – no prob).
(Since the position is to the right: element should slide to the left.)

link 1: show textfield1 (div) – hide link2 (if shown)
link 2: show textfield2 (div) – hide link1 (if shown)

And when for example link1 is active // textfield1 is shown:
link 1: hide textfield1

What I found:
[url]http://www.webdeveloper.com/forum/showthread.php?t=199890[/url]
which is not bad at all. However it doesn’t hide a textfield when shown.

My question:
How to alter the script to do this additional action?

[CODE]$(document).ready(function(){
$(“.toelichting”).hide();
$(“.map”).hide();
$(“ul li a”).click(function () {
var divname= this.title;
$(“.”+divname).show(“slow”).siblings().hide(“slow”);
});
});[/CODE]

[code=html]<ul>
<li> <a title=”toelichting” href=”#”>txt</a></li>
<li> <a title=”map” href=”#”>map</a> </li>
</ul>

<p class=”toelichting”>Dummy text here</p>
<p class=”map”>Dummy map here</p>
[/code]

Any help is greatly appreciated!

3Pinter

Oh and btw: tips / better approach are also welcome

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @3Pinter spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...