Hey guys,
This isn’t really a specific kirby issue. But I’m using kirby and thought one of you fine gentlemen might know what to do.
I currently have a parent blog page setup which is pulling from each children page in the panel. Each child page is an article, and I have that listed all on the blog parent page.
The code looks like this:
<section class="blog two">
<?php foreach($page->children()->visible()->flip() as $subpage): ?>
<div class="information">
<a class="standfirst" href="#">
<h2 class="blog-title"><?php echo $subpage->name()?></h2>
<p><?php echo $subpage->blogdate()->kirbytext()?></p>
</a>
<div class="content">
<p><?php echo $subpage->text()->kirbytext()?></p>
</div>
</div>
<div class="image">
<?php foreach ($subpage->blogimage()->toStructure() as $item): ?>
<img class="blog-image" src="<?php echo $item->image()?>">
<?php endforeach ?>
</div>
<?php endforeach ?>
</section>
And the result looks like this:
So I want the image to stay put in the same place while only the user scrolls the text. Once they get to the bottom. The next article does the same thing.
I was attempting to use jQuery Stick ‘em but ran into problems since my page is all the content from the cms using foreachs, it gets a bit messy.
If anyone could shed some light on how to start this as a noobie to javascript that would be amazing.
Thanks!
Edit: This is pretty much excatly the basics of what I want. Edit fiddle - JSFiddle - Code Playground
But i cannot seem to integrate it into my site and get it work.