Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery show hidden content, then auto scroll to the middle of the content
    primarykey
    data
    text
    <p>I have a button set up that when clicked, expands the page. Here is the code:</p> <pre><code>/*Source:http://rpardz.com/blog/show-hide-content-jquery-tutorial*/ jQuery('.open-content').hide().before('&lt;div class="container_12"&gt;&lt;a href="#" id="toggle-content" class="button"&gt;&lt;div id="expand-button" &gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;div id="toggle-top" style="width:100%"&gt;&lt;/div&gt;'); jQuery('a#toggle-content').click(function() { jQuery('.open-content').slideToggle(1000); return false; }); </code></pre> <p>It works nicely as you can see: Hidden: <a href="http://cl.ly/101v0N0W1z2D2e0x3a0j" rel="nofollow">http://cl.ly/101v0N0W1z2D2e0x3a0j</a> Expanded: <a href="http://cl.ly/1Z2Q1d3Y2z2X3G1j1v2G" rel="nofollow">http://cl.ly/1Z2Q1d3Y2z2X3G1j1v2G</a></p> <p>Notice (see the scroll on the side of the images) how the bottom of page expands to show more content; what I can't figure out is how to make the page auto scroll to the bottom of the now visible content after the page finishes expanding.. </p> <p>I use this standard script to smooth scroll to places on the page..</p> <pre><code>/*Source: http://goo.gl/DaRfF */ jQuery(document).ready(function($) { $(".scroll").click(function(event){ event.preventDefault(); $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500); }); </code></pre> <p>});</p> <p>but I cannot see how to integrate this so that it automatically scrolls to the bottom of the content after it finishes expanding. All help is greatly appreciated, thanks!</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.
    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