Hello people i have this script
<a class="clickMe" toggle="first">Text 1</a>
</br>
<div id="first" class="text"> - This text will be toggled</div>
<a class="clickMe" toggle="second">Text 2</a>
</br>
<div id="second" class="text"> - This text will be toggled 2</div>
and the jquery
$('a.clickMe').click(function () {
id = $(this).attr('toggle');
$('.text').not('#' + id).hide();
$('#' + id).show();
});
above code works fine by toggling This text will be toggled or This text will be toggled 2 when we click on Text 1 or Text 2 is clicked, please check the demo
but now what i trying to do is to have fixed position/alignment for the toggled text,right now it is toggled below Text 1 or Text 2 ,BUT I NEED TO PUT THIS ON RIGHT HAND SIDE SO THAT WHEN EVER ANYONE OF THE TEXT1 OR TEXT2 IS CLICKED TOGGLED STATEMENT SHOULD BE SHOWN ON THE SAME PLACE(RIGHT SIDE NOT BELOW) …PLEASE HELP ME TO FIX THIS….
Why not try this by using jQuery’s
.text()feature: