If you want to maintain a floating block of text or image above the moving images underneath, simply utilize CSS with "position:fixed;".
.floating-block {
position: fixed;
top: 25%;
right: 25%;
width: 50%;
border: 3px solid red;
background-color: white;
}
For instance:
https://jsfiddle.net/NYCguyJason/vxcj31zj/
Alternatively... (clarifying your query)
If your goal is to have an image in a fixed position that remains unaffected by page scrolling, check out this example:
https://jsfiddle.net/NYCguyJason/4n9ab0x6/1/
.fixedBackground {
width: 100%;
position: fixed;
top: 0;
}
Updates
Updates
**UPDATES Based on your recent comments **
In response to your feedback, here are some additional suggestions to achieve your desired outcome:
1. Pure CSS:
Adjust the "z-indexes" so that specific elements remain on top of others. (higher z-index values stay on top. Remember to assign a "position" for utilizing "z-index")
Demo:
https://jsfiddle.net/NYCguyJason/vxcj31zj/1/
.fullwidthblock { /* initial background */
position: relative;
z-index: 1;
}
.floating-block { /* floating block */
position: fixed;
z-index: 2;
}
.stayOnTop { /* elements further down that should always stay on top */
position: relative;
z-index: 3;
}
?Using jquery on your site?
2. Custom JavaScript or JQuery:
Maintain the element fixed until reaching a certain point during scroll, then allow it to move along.
Refer to this solution (note: using an older jQuery version):
Stopping fixed position scrolling at a certain point?
3. A comprehensive JQuery plugin:
Sticky Kit
--Looks promising
ScrollTo Fixed
--Best option available, as demonstrated in the updated jsfiddle:
https://jsfiddle.net/NYCguyJason/bn9ekcds/7/
<!-- include jquery -->
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<!-- include plugin script -->
<script type="text/javascript" src="https://cdn.rawgit.com/bigspotteddog/ScrollToFixed/master/jquery-scrolltofixed-min.js"></script>
<!-- activate the plugin -->
<script type='text/javascript'>
$(window).load(function(){
$('.floating-block').scrollToFixed({
marginTop: 80, //starting point from top of window
// limit: $($('.stayOnTop')).offset().top
limit: 550 //trigger point for fixed element to scroll up
});
});
</script>