Browse Source

Fix sticky example load issue

1.x
jlukic 10 years ago
parent
commit
fc255e98c4
  1. 4
      server/documents/behaviors/visibility.html.eco
  2. 11
      server/files/javascript/sticky.js
  3. 2
      server/files/javascript/visibility.js

4
server/documents/behaviors/visibility.html.eco

@ -13,7 +13,7 @@ type : 'UI Behavior'
<script src="/javascript/visibility.js"></script>
<%- @partial('header', { tabs: { introduction: 'Introduction', examples: 'Examples', usage: 'Usage', settings: 'Settings' } }) %>
<%- @partial('header', { tabs: { introduction: 'Introduction', usage: 'Usage', examples: 'Examples', settings: 'Settings' } }) %>
<div class="main container">
@ -744,7 +744,7 @@ type : 'UI Behavior'
<tr>
<td>throttle</td>
<td>false</td>
<td>When set to a value, scroll position will be debounced using this ms value. Defaults to <code>useAnimationFrame</code> for adjusting visibility.</td>
<td>When set to an integer, scroll position will be debounced using this ms value. <code>false</code> will debounce with <code>requestAnimationFrame</code>.</td>
</tr>
<tr>
<td>observeChanges</td>

11
server/files/javascript/sticky.js

@ -14,10 +14,6 @@ semantic.sticky.ready = function() {
};
setTimeout(function() {
$('.main.container .sticky.example .sticky').sticky('refresh');
$('.main.container .pushing.example .sticky').sticky('refresh');
}, 500);
$('.main.container .pushing.example')
.each(function() {
@ -73,4 +69,9 @@ semantic.sticky.ready = function() {
// attach ready event
$(document)
.ready(semantic.sticky.ready)
;
;
$(window).load(function() {
$('.main.container .sticky.example .sticky').sticky('refresh');
$('.main.container .pushing.example .sticky').sticky('refresh');
});

2
server/files/javascript/visibility.js

@ -167,7 +167,7 @@ window.loadFakeContent = function() {
$('.visibility.example > .overlay, .visibility.example > .demo.segment, .visibility.example .items img')
.visibility('refresh')
;
}, 500);
}, 1000);
}
count++;
}

Loading…
Cancel
Save