Inserting JS/jquery plugins/elements into C5.7?

Permalink
I'm having trouble using Jquery plugins in C5.7 I'm not sure entirely the best way to go about this - should I just make an entire plugin? I'm really just trying to make certain elements "sticky" and I'm planning on using this jquery plugin, just to make the header element sticky.

http://stickyjs.com/

Is there an easy way to use Jquery/JS in concrete 5?

 
maar replied on at Permalink Reply
maar
As I see this, it is quite simple.

First you add the following line to the footer of your theme:

<script type="text/javascript" src="<?php echo $view->getThemePath()?>/yourpath/jquery.sticky.js"></script>


Then you add this code in the footer too:

<script>
  $(document).ready(function(){
    $("#sticker").sticky({topSpacing:0});
  });
</script>


as you see it will point at a container ID with the name of "#sticker". You could probably call this something else (even a class fx. ".sticker" not sure of this). Now you just need to add the class or ID name to your header container.
AJTD replied on at Permalink Reply
Sadly there is still no effect after I've done this.

I added the #ID to the header, and then tried adding it to every element in the header. I'm using the Clonemental theme for my website atm and making edits through that. I've tried relative and absolute paths, neither seem to work >_>
maar replied on at Permalink Reply
maar
I do not know how your theme is put together. But still, it should be possible if you follow the description!

Have you changed "yourpath" in my example?
AJTD replied on at Permalink Reply
My theme so far is just the lightly edited Clonemental (elemental clone) theme, I'll keep messing with I'm sure I'm doing something wrong.
maar replied on at Permalink Reply
maar
I do not have the time to test it out at the moment. But it should be a fairly simple task, so good luck with it!
AJTD replied on at Permalink Reply
Thanks! I'll report back if I figure it out.