Improvement suggestions
-
Hi,
First of all: thanks for this plugin!
And some suggestions that might improve some aspects of the plugin:
1. To prevent the script being included on every page while it is likely only one page where we need it, you could do something like this:
In wp-jquery-roundabout.php change
wp_enqueue_script('jquery-roundabout', plugins_url('/js/jquery.roundabout.min.js', __FILE__), array('jquery') );to
wp_register_script('jquery-roundabout', plugins_url('/js/jquery.roundabout.min.js', __FILE__), array('jquery'), '2.4.2', true );and remove the line to enqueue the roundabout.js file (we’ll include the code snippet into the page source later to save one more server request).
Then add to function wprabt_shortcode the line (just before
return...)
add_action('wp_footer', 'wprabt_print_script');And finally add a new function called wprabt_print_script at the end:
function wprabt_print_script() { wp_print_scripts('jquery-roundabout'); echo ' <script type="text/javascript"> jQuery(document).ready(function($) { $(\'#wp-roundabout\').roundabout(); }); </script> '; }2. Upgrade to version 2.4.2 of the jquery-roundabout script. The current one shows some weird behavior (spinning out of control) in combination with the easing script…
3. The css might need some work: I get only the top half the carousel in Chrome since the style rule
#roundabout-container { height: 90%; }does not do anything. Or maybe something like this in wp-jquery-roundabout.php function display_carousel:echo '<div id="roundabout-container" style="height:'.get_option('wprabt_img_height').'px;overflow:hidden">';Plus something like this to make images scale to the li container:
ul#wp-roundabout img { max-width: 100%; height: auto; box-shadow: 0 6px 10px -3px #000; /* subtle drop shadow improves visibility */ }because on my site the images remain at the preset size even if they move behind the on in focus. No idea why the contained images are not scaled by the script, maybe it’s an issue with jQuery 1.10 … But this simple CSS seems to solve it without javascript 🙂
The topic ‘Improvement suggestions’ is closed to new replies.