Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m trying to show adiv tag using a hyperlink...
i tried
HTML
<li class="odd"><a href="#recent">Video</a></li>



<div id="tabvanilla" class="widget">

   <ul id="countrytabs" class="shadetabs">
   <li><a href="#popular">Popular</a></li>
   <li><a href="#recent">Recent</a></li>
   <li><a href="#featured">Featured</a></li>
   </ul>

   <div id="popular" class="tabdiv">
   <ul>
   <li><a href="#">Welsh Zombie Sheep Invasion</a></li>
   <li><a href="#">Sheep Rising From The Dead</a></li>
   <li><a href="#">Blogosphere Daily Released!</a></li>

   </ul>
   </div><!--/popular-->

   <div id="recent" class="tabdiv">
   <p>Lorem ipsum dolor sit amet.</p>
   </div><!--/recent-->

   <div id="featured" class="tabdiv">
   <ul>
   <li><a href="#">Aliens Infiltrate Army Base In UK Town</a></li>
   <li><a href="#">Are We Alone? A Look Into Space</a></li>
   <li><a href="#">U2 Rocks New York's Central Park</a></li>

   </ul>
   </div><!--featured-->

   </div>

can anyone tell me how to do this
Posted
Comments
VICK 10-Sep-13 6:26am    
R u trying to perform this through JAVASCRIPT???
Miss Maheshwari 10-Sep-13 6:32am    
yeah tried but no result
Dholakiya Ankit 10-Sep-13 6:33am    
can u post code?
Miss Maheshwari 10-Sep-13 6:41am    
<script language="javascript" type="text/javascript">
var currentTab = 0;
$(function () {
$("#tabs").tabs({
select: function (e, i) {
currentTab = i.index;
}
});
});
$("#btnNext").live("click", function () {
var tabs = $('#tabvanilla').tabs();
var c = $('#tabvanilla').tabs("length");
currentTab = currentTab == (c - 1) ? currentTab : (currentTab + 1);
tabs.tabs('select', currentTab);
$("#btnPrevious").show();
if (currentTab == (c - 1)) {
$("#btnNext").hide();
} else {
$("#btnNext").show();
}
});
$("#btnPrevious").live("click", function () {
var tabs = $('#tabvanilla').tabs();
var c = $('#tabvanilla').tabs("length");
currentTab = currentTab == 0 ? currentTab : (currentTab - 1);
tabs.tabs('select', currentTab);
if (currentTab == 0) {
$("#btnNext").show();
$("#btnPrevious").hide();
}
if (currentTab < (c - 1)) {
$("#btnNext").show();
}
});
</script>

<input type="button" id="btnPrevious" value="Previous" style = "display:none"/>
<input type="button" id="btnNext" value="Next" />
Nagesh Reddy 10-Sep-13 7:58am    
Instead use Jquery...

$(document).ready(function(){
$("#popular").css({"display":"none"});
$("#recent").css({"display":"none"});
$("#featured").css({"display":"none"});
// add id for each a link

$("#aPopular").click(function(){

$("#popular").css({"display":"block"}); //or inline
$("#recent").css({"display":"none"});
$("#featured").css({"display":"none"});
});

$("#aRecent").click(function(){

$("#popular").css({"display":"none"});
$("#recent").css({"display":"block"});
$("#featured").css({"display":"none"});
});
$("#aFeatured").click(function(){

$("#popular").css({"display":"none"});
$("#recent").css({"display":"none"});
$("#featured").css({"display":"block"});
});

});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900