idkline
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Athena] Jumbatron not working in Athena themeIn addition, to maintain the fix, create a child theme, copy the camera.js file to the child theme (perhaps duplicate the directory structure of the Athena theme), then add this code to the child theme’s functions.php file:
function athena_replace_scripts() {
// Dequeue & Deregister the original camera.js file
wp_dequeue_script( ‘athena-camera’ );
wp_deregister_script( ‘athena-camera’ );// Enqueue the fixed camera.js file
wp_enqueue_script(‘athena-fix-camera’, get_stylesheet_directory_uri() . ‘/inc/js/camera.js’, array(‘jquery’), ATHENA_VERSION, true);
}
// add the action to execute the code with a priority of 11 – this ensures that the action will execute after the main theme’s queue.
add_action(‘wp_enqueue_scripts’, ‘athena_replace_scripts’, 11);This code fragment assumes the camera.js file is located in a sub-directory of the child theme – /inc/js/ (similar directory structure of the Athena main theme, but could be placed anywhere in the child theme’s directory).
Forum: Themes and Templates
In reply to: [Athena] Jumbatron not working in Athena themeThe reason this is causing problems is the .live method.
Apparently the developer stopped updating this camera.js plugin around 2014.There are 4 instances of .live on lines 727, 732, 751, & 767 in the file /wp-content/themes/athena/inc/js/camera.js
The .live method was deprecated and removed from jQuery as of version 1.9.
The simple fix for all 4 of these methods is to change the .live method to the .on method, like so:
727 // fakeHover.live(‘vmouseover’,function(){
change to: fakeHover.on(‘vmouseover’,function(){732 // fakeHover.live(‘vmouseout’,function(){
change to: fakeHover.on(‘vmouseout’,function(){751 // $(‘.camera_stop’,camera_thumbs_wrap).live(‘click’,function(){
change to: $(‘.camera_stop’,camera_thumbs_wrap).on(‘click’,function(){767 // $(‘.camera_play’,camera_thumbs_wrap).live(‘click’,function(){
change to: $(‘.camera_play’,camera_thumbs_wrap).on(‘click’,function(){