This has taken me days already maybe weeks, I lost count.
Been through many internet pages, examples etc.
Posted a issue perhaps on the wrong place.
Problem is when I am logged on the jquery works, when logged of is doesn't
I have my own piece of code and in my eyes appears right and...
I also have one that I found on internet, working PERFECT!
This one I found works while logged on and also when a anonymous user visits the site.
I have a hard time to understand on how to place the scripts.
But this is what I came up with.
This is a small part of template.php
function verhuur_preprocess_html(&$variables) {
$theme_path = path_to_theme();
$url = request_uri();
if ($url == '/gamma/') {
drupal_add_js($theme_path . '/js/test.js');
}
}
Then I assume since the code I found works both ways this part would be ok.
Then here is my own piece of code. Differs not much from the code below.
I am almost done with everything, just need a understanding of how to implement this.
And if I can get this going the rest would be ok.
Thanks in advance
my code
(function ($) {
Drupal.behaviors.myCustomJS = {
attach: function (context, settings) {
$('#block-block-1').click(function () {
$('#block-block-1').animate({left: "200px"},1000);
});
}
};
})(jQuery);