I have this using a number (oi) to save the old active index:
var $oldactive = $('#menu-sup span').eq(oi);
$oldactive.fadeTo (500,0.0);
$('#menuq p').removeClass ('active');
But
I want to get the index() of the active class something like:
var oi = $('#menuq p.active').index();
So I use an active class to toggle the one active on/of and want to retrieve the index number of that active class. I set in below code <p> to active and I want to get the index number of the active <p>
How?
Thanks to prior users replying to my question. I am learning now and basically all I need to learn is:
Get the date by index number or classes and then do something on that.
-------
#menuq {list-style:none;width:990px;height:50px;margin:0 auto;padding-top:20px;}
#menuq p {display:inline;}
#menuq p.active {}
#menuq li {float:left;margin:10px;cursor:pointer;width:128px;height:45px;}
<div id="menuq">
<li>
<p class="active"><img src="/wp-content/themes/ginagianni/images/home.png" /></p>
</li>
<li>
<p><img src="/wp-content/themes/ginagianni/images/handbags.png" /></p>
</li>
<li>
<p><img src="/wp-content/themes/ginagianni/images/fragrance.png" /></p>
<div class="menu-popup menu-img">
<h1>Fragrance</h1>
The Birds Will Breed and<br />
Gina Gianni Keeps Coming. <br />
<br />
Make Your Life Be a Fragrance <span style="position:absolute;top:-70px;right:-70px;"><img src="/wp-content/themes/ginagianni/images/fragrance-shelf.png"/></span> </div>
</li>
<li>
<p><img src="/wp-content/themes/ginagianni/images/diamonds.png" /></p>
<div class="menu-popup menu-img"> </div>
</li>
</div>