Deprecated: Return type of HM\BackUpWordPress\CleanUpIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/charlott/ourfragileplanet.com/site/wp-content/plugins/backupwordpress/classes/class-path.php on line 455
How to implement Scroll to Fixed - navigation effect - Our Fragile Planet

How to implement Scroll to Fixed – navigation effect

I am trying to implement a scroll to fixed navigation bar in a wordpress theme. The bar is beneath a banner image and then as the page was scrolled to a certain point the navigation would fix to the bottom of the header.

First I downloaded a jquery plugin called scroll to fixed available here.

I popped the jquery-scrolltofixed-min.js file in my js file of my theme and then put the following in my header.php between the tags:

<script src="...path to file.... /js/jquery-scrolltofixed-min.js" type="text/javascript"></script>
<script>
   jQuery(function() {
 if ( jQuery(window).width() > 1026) {   
            jQuery('#nav_bar').scrollToFixed({marginTop:100,zIndex:200});
        }
});</script>

Ta da it worked a treat.

Scroll to Top

Fatal error: Uncaught wfWAFStorageFileException: Unable to save temporary file for atomic writing. in /home/charlott/ourfragileplanet.com/site/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:34 Stack trace: #0 /home/charlott/ourfragileplanet.com/site/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(658): wfWAFStorageFile::atomicFilePutContents('/home/charlott/...', '<?php exit('Acc...') #1 [internal function]: wfWAFStorageFile->saveConfig('livewaf') #2 {main} thrown in /home/charlott/ourfragileplanet.com/site/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 34