Note that there are some explanatory texts on larger screens.

plurals
  1. POScrollTop Jquery not working properly
    primarykey
    data
    text
    <p>I have been using the ScrollTop JQuery so that when buttons are clicked in the right hand column, they scroll to the specific id in the left. It goes to the specific id when I first load the page, but after that it doesn't go to the other three, but glitches out going up or down slightly when buttons are clicked. I found that when I scroll to the top of the page and click the link it goes to the correct place, so it seems it it trying to find the top position of the left column and trying to go from there. No ideas as to how to fix this so would appreciate any thoughts.</p> <p>CSS:</p> <pre><code>html, body { height: 100%; margin: 0px auto; } #main, #col_l, #col_r { height: 100%; } div[id*="col"]{ float: left; width: 50%; overflow: auto; } #col_r{ overflow:hidden; position:relative; } </code></pre> <p>JS:</p> <pre><code>&lt;script src="jquery-1.10.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery.scrollTo-1.4.3.1-min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#stsp").click(function() { $('#col_l').animate({ scrollTop: $("#lgg").offset().top}, 2000); }); $("#fg").click(function() { $('#col_l').animate({ scrollTop: $("#funny").offset().top}, 2000); }); $("#covers").click(function() { $('#col_l').animate({ scrollTop: $("#coverso").offset().top}, 2000); }); $("#demo").click(function() { $('#col_l').animate({ scrollTop: $("#mp3").offset().top}, 2000); }); }); </code></pre> <p></p> <p>HTML:</p> <pre><code>&lt;div id="col_r"&gt; &lt;div id="hb"&gt;&lt;a href="Foreigner.zip"&gt;&lt;button id="demo"&gt;One &amp;times; Fifteen (64mb) &lt;/button&gt;&lt;/a&gt;&lt;/div&gt; &lt;div id="lg"&gt;&lt;button id="stsp"&gt;Same Time Same Place&lt;/button&gt;&lt;/div&gt; &lt;div id="fg"&gt;&lt;button id="funny"&gt;Funny Games Funny Games&lt;/button&gt;&lt;/div&gt; &lt;div id="c"&gt;&lt;button id="covers"&gt;Covers Over Covers&lt;/button&gt;&lt;/div&gt; &lt;/div&gt; </code></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.
    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