Note that there are some explanatory texts on larger screens.

plurals
  1. POChange view modes with fade-in and fade-out (and set a cookie)
    primarykey
    data
    text
    <p>I need to give users the option to choose view modes between <code>List-view</code>, <code>Grid-view</code>, and <code>Full-view</code>. The basic structure is simple, something like this:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;List Toggle&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Grid Toggle&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Full Toggle&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="wrap"&gt; &lt;div id="list-view"&gt; &lt;div class="line"&gt;lorem line&lt;/div&gt; &lt;div class="line"&gt;lorem line&lt;/div&gt; &lt;div class="line"&gt;lorem line&lt;/div&gt; &lt;/div&gt; &lt;div id="grid-view"&gt; &lt;div class="box"&gt;lorem box&lt;/div&gt; &lt;div class="box"&gt;lorem box&lt;/div&gt; &lt;div class="box"&gt;lorem box&lt;/div&gt; &lt;/div&gt; &lt;div id="full-view"&gt; &lt;div class="full"&gt;full lorem&lt;/div&gt; &lt;div class="full"&gt;full lorem&lt;/div&gt; &lt;div class="full"&gt;full lorem&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Here is a <code>jsfiddle</code> I started with <code>list-view</code> set as visible and others hidden:</p> <p><a href="http://jsfiddle.net/eTb5C/13/" rel="nofollow">http://jsfiddle.net/eTb5C/13/</a></p> <p>Here is one I was thinking of implementing, but need it for 3 options.. <a href="http://jsfiddle.net/mgNQy/2/" rel="nofollow">http://jsfiddle.net/mgNQy/2/</a></p> <p>Basically, if you click on a view mode, the current view mode will fade out and the selected view mode will fade in.</p> <p>I would also like to add a cookie to remember the user's preference if possible, but I don't know how to do that. I am pretty new to jQuery hopefully my questions aren't too basic.</p>
    singulars
    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