Note that there are some explanatory texts on larger screens.

plurals
  1. POShow/Hide button (text) for Accordion
    primarykey
    data
    text
    <p>Have an accordion with a "view" button to open close the accordion panel (using jQuery Tools), but I would like to have dynamic text that says "show/hide" depending on the state...</p> <p>Here is the code for the accordion in asp.NET</p> <pre><code>&lt;div id="accordion"&gt; &lt;% foreach (var eventModel in ViewModel) { %&gt; &lt;% var isNewMonth = eventModel.Date.Month != previousMonth; %&gt; &lt;% if (isNewMonth &amp;&amp; previousMonth &gt; 0) { %&gt;&lt;/table&gt;&lt;/div&gt;&lt;% } %&gt; &lt;% previousMonth = eventModel.Date.Month; %&gt; &lt;% if (isNewMonth) { %&gt; &lt;h2&gt;&lt;%= string.Concat(eventModel.Date.ToString("MMMM"), " ", eventModel.Date.Year) %&gt; &lt;span style="float:right;"&gt;&lt;a href="#" class="button blue small"&gt;View&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt; &lt;div class="pane" style="display:block"&gt; &lt;table id="listTable" width="100%" cellpadding="3" cellspacing="0" border="0"&gt; &lt;tr align="left" valign="top"&gt;&lt;th align="left" valign="top"&gt;Date&lt;/th&gt;&lt;th align="left" valign="top"&gt;Event&lt;/th&gt;&lt;th align="left" valign="top"&gt;Event Type&lt;/th&gt;&lt;/tr&gt; &lt;% } %&gt; &lt;tr align="left" valign="top"&gt;&lt;td align="left" valign="top"&gt;&lt;b&gt;&lt;span id="date" style="float:left;"&gt; &lt;%= string.Concat(eventModel.Date.ToString("MMMM"), " ", eventModel.Date.Day, " &lt;/span&gt;&lt;span id='day' style='float:left'&gt;" + eventModel.Date.DayOfWeek + "&lt;/span&gt; ")%&gt;&lt;/b&gt;&lt;/td&gt;&lt;td align="left" valign="top" &gt;&lt;%= Html.ActionLink(eventModel.Name.Truncate(40), "event", "register", new { id = eventModel.Id }, null)%&gt;&lt;/td&gt;&lt;td align="left" valign="top"&gt;&lt;%= string.Concat(" ", eventModel.Sport)%&gt;&lt;/td&gt;&lt;/tr&gt; &lt;% } %&gt; &lt;% if (ViewModel.Count &gt; 0) { %&gt;&lt;/table&gt;&lt;/div&gt;&lt;% } %&gt; &lt;/div&gt; </code></pre> <p>Here is the initialization script using jQuery:</p> <pre> $(function() { $("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: 0}); $(".small").click(function() { moveToTop(); }); }); </pre>
    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.
    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