Fix for non-javascript users, or slow-loading content flashiness
-
If you have javascript disabled, all slides are displayed. We also had some reports of the slideshow “flashing”. Not sure what they meant, and our content is very simple, but having used cycle2 I know sometimes all the content is initially visible even with javascript on, briefly.
So the fix is easy, just a choice if you want to use pure css, or a css class in the html, or a style in the html, or filter hooks.
* pure css : do not need to mod the plugin. Mess around with “.testimonial_rotator .slide { display: none } .testimonial_rotator .slide:first { display: block }”. I didn’t try it, since older browsers would probably fail to show anything.
* css class in the html : mod the plugin html to add a class for all slides after the first. Then put a matching “display: none” rule in the css. This is probably the best solution for the developer.
* style in the html : mod the plugin to add a style for all slides after the first. This is how I chose to do it, until the bug is fixed. I need max compatibility with old browsers, and this is easy.
testimonial-rotator.php, version 1.3.6, line 417:
$my_slide_style= ''; // add this line while ( $testimonials->have_posts() ) { $testimonials->the_post(); $slide = "<div class=\"slide cf-tr\"$my_slide_style>\n"; // add the variable if($addClass) $my_slide_style= ' style="display: none;"'; // add this line
And a similar fix at line 558.
* filter hooks. Exercise for the reader. The hooks are
testimonial_rotator_widget_slide
andtestimonial_widget_slide
. Hint: you can use a static variable to keep track of the slide count.
- The topic ‘Fix for non-javascript users, or slow-loading content flashiness’ is closed to new replies.