$().ready(function() not working
-
I am working on a coda slider plugin for my site, but the $().ready(function() won’t work in Firefox. Evey other browser I have tried (chrome, safari, opera, IE) works fine. Here is where I call the function from a shortcode. The site is https://beta.danstechstop.com
function shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'query' => null, 'id' => null, 'args' => null ), $atts ) ); //Make sure there is a query and name if (! $query || ! $id) return 'Could not load slider. Mallformed shortcode.'; $add_my_script = true; $o = ' <div class="coda-slider-wrapper"> <div class="coda-slider preload" id="'. $id .'">'; $posts = get_posts($query . 'numberposts=-1'); foreach($posts as $post){ $o.= '<div class="panel" id="post-' . $post->ID . '"> <div class="panel-wrapper"> <h2 class="title">' . $post->post_title . '</h2> ' . $post->post_content . ' </div> <!-- .panel-wrapper --> </div><!-- .panel #post-$id -->'; } $o.=' </div><!-- .coda-slider .preload --> </div><!-- coda-slider-wrapper --> <script type="text/javascript"> $().ready(function() { $('. $id .').codaSlider({' . $args .'}); }); </script>'; return $o; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘$().ready(function() not working’ is closed to new replies.