
Originally Posted by
mingis
I'm having a similar issue
Well, yes and no. You have a script conflict. But it has nothing to do with jQuery. It's a conflict between mootools and prototype. I'm aware of no fix for this other than eliminating one of the libraries. And I'm a bit surprised that it works in any browser, but not too surprised.
I know you say you cannot change the head, so you may be out of luck. But you can use jQuery instead, and it looks like that would work. To do so, get rid of this:
Code:
<script type="text/javascript">
function pageScroll() {
var x = document.viewport.getDimensions().height + document.viewport.getScrollOffsets().top - (entry.getHeight() + entry.cumulativeOffset().top);
if (x > 0) {
if (parseInt(share_popout.getStyle('top')) != 0)
share_popout.morph({top: '0px'}, {duration: 0.5});
}
else {
if (parseInt(share_popout.getStyle('top')) != -250)
share_popout.morph({top: '-250px'}, {duration: 0.5});
}
}
</script>
and this:
Code:
<script type="text/javascript">
var entry = $('container').select('div.entry').first();
var share_popout = $('share_popout');
if(window.addEventListener) {
window.addEventListener('scroll', pageScroll, false);
}
else if(window.attachEvent) {
window.attachEvent('onscroll', pageScroll);
}
</script>
Then replace either one of them not both with this:
Code:
<script type="text/javascript">
jQuery(function($){
var entry = $('#container div.entry').first(), share_popout = $('#share_popout'), w = $(window), x;
function pageScroll(){
x = w.height() + w.scrollTop() - (entry.height() + entry.offset().top);
if (x > 0){
if (parseInt(share_popout.css('top')) !== 0){
share_popout.stop(true).animate({top: '0px'}, {duration: 500});
}
} else {
if (parseInt(share_popout.css('top')) !== -250){
share_popout.stop(true).animate({top: '-250px'}, {duration: 500});
}
}
}
w.scroll(pageScroll);
});
</script>
A different solution would be to simply (as you don't appear to be using it) get rid of this:
Code:
<!-- begin nextgen-smooth scripts -->
<script type="text/javascript" src="http://www.outlookbathrooms.com.au/wp-content/plugins/nextgen-smooth-gallery/SmoothGallery/scripts/mootools.v1.11.js"></script>
<script type="text/javascript" src="http://www.outlookbathrooms.com.au/wp-content/plugins/nextgen-smooth-gallery/SmoothGallery/scripts/jd.gallery.js"></script>
<script type="text/javascript" src="http://www.outlookbathrooms.com.au/wp-content/plugins/nextgen-smooth-gallery/SmoothGallery/scripts/jd.gallery.transitions.js"></script>
<link type="text/css" href="http://www.outlookbathrooms.com.au/wp-content/plugins/nextgen-smooth-gallery/SmoothGallery/css/jd.gallery.css" rel="stylesheet" media="screen" />
<!-- end nextgen-smooth scripts -->
You could do both and it would speed up load time. You might even be able to get rid of the two prototype scripts as well. Getting rid of all that code would be a great idea if it works out.
Bookmarks