Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery slide up and down what should i do?
    primarykey
    data
    text
    <p>im not familiar with jquery so any help would be appreciated, i have some code, (cant remember where from) that shows part of the content and then allows you to show more or less.</p> <p>What i would like the code to do is exactly what it does now, but instead of just show / hide, i want it to slide down and up revealing more or less content.</p> <p><strong>THE WHOLE CODE</strong></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Show more less&lt;/title&gt; &lt;style media="screen" type="text/css"&gt; #mytext {width:260px;height:200px;overflow:hidden;} &lt;/style&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var adjustheight = 200; $("#adjust").toggle(function() { $('#mytext').css('height', 'auto').css('overflow', 'visible'); $(this).text("less"); }, function() { $('#mytext').css('height', adjustheight).css('overflow', 'hidden'); $(this).text("more"); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="mytext"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque iaculis tincidunt tortor. Nulla turpis dui, gravida non, varius quis, molestie sit amet, justo. Vestibulum sed elit. Duis lobortis odio quis nisi. Praesent enim. Sed auctor commodo lectus. In eget augue a nulla auctor interdum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla enim turpis, commodo at, feugiat nec, dapibus et, odio. Cras enim risus, sagittis eget, ultrices quis, eleifend vel, risus. Cras a felis eu urna ornare vulputate. Pellentesque viverra, lacus vitae tincidunt accumsan, nisi metus feugiat felis, sed placerat est dolor et eros. Duis cursus. Maecenas sollicitudin, lorem vitae placerat eleifend, dui elit imperdiet tellus, at convallis sapien orci sed pede.&lt;/div&gt; &lt;a href="#" id="adjust"&gt;more&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>its currently controlled by changing the height in the css any way to animate this? Thanks</p>
    singulars
    1. This table or related slice is empty.
    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.
    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