Note that there are some explanatory texts on larger screens.

plurals
  1. POReset scrollbar position in DIV Safari 6.0.4
    text
    copied!<p>I am having a similar issue as below with a scroll reset:</p> <p><a href="https://stackoverflow.com/questions/2694243/how-to-reset-persistent-scrollbar-position-after-div-refresh-in-ff3">How to reset persistent scrollbar position after div refresh in FF3?</a></p> <p>The scrollLeft works in FF and Chrome, but not in Safari 6.0.4. It is very strange as the code looks sound to me (although I have not been doing this long!) My code is set up as below:</p> <p>The link</p> <pre><code> &lt;a id="bakers" href="#"&gt;bakers dozen&lt;/a&gt; </code></pre> <p>This is the div I need to call from a separate html file</p> <pre><code> &lt;div id="bakers2"&gt; &lt;div class="gallery"&gt;&lt;img src="images/9.Bakersdozen/2.bakers.jpg" alt="" /&gt;&lt;p&gt;January&lt;/p&gt;&lt;/div&gt; &lt;div class="gallery"&gt;&lt;img src="images/9.Bakersdozen/1.bakers.jpg" alt="" /&gt;&lt;p&gt;February&lt;/p&gt;&lt;/div&gt; </code></pre> <p>into this on the body index page</p> <pre><code>&lt;div class="slider"&gt; &lt;/div&gt; </code></pre> <p>the CSS:</p> <pre><code>.slider { left: 285px; position: absolute; top: 150px; } .gallery { float: left; margin: 5px; } #bakers2 { width:2650px; } </code></pre> <p>and the script (which is in the body)</p> <pre><code> $(document).ready(function() { $('#bakers').click(function(){ $('.slider').load("bakers.html #bakers2"); $('body').scrollLeft(0); }); }); </code></pre> <p>Thanks for your help. Please let me know if I have missed any code that you'd need in order to help</p>
 

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