• Resolved danstech

    (@danstech)


    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 http://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)
  • Thread Starter danstech

    (@danstech)

    I found my problem… I needed coffee! I missed the # in the function…

    $o.='
    				</div><!-- .coda-slider .preload -->
    			</div><!-- coda-slider-wrapper -->
    			<script type="text/javascript">
    				$().ready(function() {
    					$(\'#'. $id .'\').codaSlider({' . $args .'});
    				});
    			</script>';

    Hi

    Great plugin. I am currently using Coda Slider on my website but I have been encountering a conflict problem.

    The coda slider works perfectly but plugins within the posts aren’t working. The only thing it displays is the shortcode.

    Any ideas?

    Thanks
    Laura

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$().ready(function() not working’ is closed to new replies.