Note that there are some explanatory texts on larger screens.

plurals
  1. POWant to make Inactive hyperlink
    primarykey
    data
    text
    <p>I have problem in hide and show the div element. In this scenario when user click on the year the respect content is shown. <strong>Problem</strong> I want to inactive hyperling on respective year when it is opened. the script and html is below for this i have tried .preventDefault(). but not got success.</p> <pre><code> &lt;script type="text/javascript" &gt; $(document).ready(function() { $("div.new:gt(0)").hide();// to hide all div except for the first one $("div[name=arrow]:eq(0)").hide(); // $("div.nhide:gt(0)").hide(); // $("a[name=new]").hide(); $("a[name=new]").hide(); $('#content a').click(function(selected) { var getID = $(this).attr("id"); var value= $(this).html(); if( value == '&amp;lt;&amp;lt; Hide') { // $("#" + getID + "arrow").hide(); $("a[name=new]").hide(); $("#" + getID + "_info" ).slideUp('slow'); $("div[name=arrow]").show(); $("div.new").hide(); $(this).hide(); // var getOldId=getID; // $("#" + getID ).html('&amp;lt;&amp;lt; Hide').hide(); } if($("a[name=show]")) { // $("div.new:eq(0)").slideUp() $("div.new").hide(); $("div[name=arrow]").show(); $("a[name=new]").hide(); $("#news" + getID + "arrow").hide(); $("#news" + getID + "_info" ).slideDown(); $("#news" + getID ).html('&amp;lt;&amp;lt; Hide').slideDown(); } }); }); &lt;/script&gt; </code></pre> <p>the html code is below</p> <pre><code> &lt;div id="content"&gt; &lt;div class="news_year"&gt; &lt;a href="#" name="show" id="2012"&gt; &lt;div style="float:left;" name="year" id="news2012year"&gt;**2012** &lt;/div&gt; &lt;div style="float:left;" name="arrow" id="news2012arrow"&gt;&amp;gt;&amp;gt;&lt;/div&gt; &lt;/a&gt; &lt;/div&gt; &lt;div class="new" id="news2012_info"&gt; &lt;div class="news"&gt; &lt;div class="news_left"&gt;News for 2012&lt;/div&gt; &lt;/div&gt; &lt;div class="nhide" &gt;&lt;a href="#" class="new" name="new" id="news2012"&gt;&amp;lt;&amp;lt; Hide&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;div class="news_year"&gt; &lt;a href="#" name="show" id="2011"&gt; &lt;div style="float:left;" name="year" id="news2012year"&gt;2012 &lt;/div&gt; &lt;div style="float:left;" name="arrow" id="news2012arrow"&gt;&amp;gt;&amp;gt;&lt;/div&gt; &lt;/a&gt; &lt;/div&gt; &lt;div class="new" id="news2011_info"&gt; &lt;div class="news"&gt; &lt;div class="news_left"&gt;News for 2011&lt;/div&gt; &lt;/div&gt; &lt;div class="nhide" &gt;&lt;a href="#" class="new" name="new" id="news2011"&gt;&amp;lt;&amp;lt; Hide&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><a href="http://jsfiddle.net/ethagnawl/sn4aG/" rel="nofollow">Fiddle</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload