Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've installed and activated the module, entered the following code into appropriate fields on the content type, and i'm not seeing any effect. CSS effects are working fine. The problem appears to be js related. Please can you advise on tests I can perform to see what may be broken.
Edit content => vertical menus => CSS& Javascript => Javascript
===
alert('videoBG behaviour triggering');
(function ($) {
Drupal.behaviors.CpnTest = {
attach: function(context, settings) {
$('#content').css("font-size", 20);
})
}
};
})(jQuery);
===
Comments
Comment #1
Syntapse CreditAttribution: Syntapse commentedComment #2
Syntapse CreditAttribution: Syntapse commentedmore info
======
an alert on its own works....
e.g. alert('javascript executing from node');
but this jquery code doesnt...
$(document).ready(function() {
$("body").css("font-size", "20px");
});
Any advice will be very much appreciated.
Comment #3
Syntapse CreditAttribution: Syntapse commentedthis shows the alert but not the query effect...
alert('javascript executing from node');
(function ($) {
$("body").css("color", "green");
}(jQuery));
Comment #4
DamienMcKennaYou probably have to wrap it in a Drupal behavior - give that a shot, let me know how it goes.
Comment #5
DamienMcKenna