ThemeShaper Forums » Thematic

jQuery again (supersized this time)

(5 posts)
  • Started 4 years ago by lastraw
  • Latest reply from nvdg
  • This topic is resolved
  1. I went through all the jQuery topics to see how to integrate supersized script but I'm not doing something right. If someone could take a look I'd appreciate it. I'd also like to make it conditional to the home page...

    <?php
    //JQuery
    function re_init_jQuery() {
    	if (!is_admin()) {
    		wp_deregister_script('jquery');
    		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 're_init_jQuery');
    ?>
    <?php
    //Supersized for homepage
    function supersized_script() {?>
    	<script src="http://dev.jquery.com/view/tags/ui/latest/ui/effects.core.js"></script>;
    	<script type="text/javascript" src="/scripts/supersized/supersized.2.0.js"></script>;
    <?php
    		jQuery(function(){
    			jQuery.fn.supersized.options = {
    				startwidth: 1024,
    				startheight: 768,
    				vertical_center: 1,
    				slideshow: 1,
    				navigation: 1,
    				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
    				pause_hover: 0,
    				slide_counter: 1,
    				slide_captions: 1,
    				slide_interval: 100000
    			};
    	        jQuery('#supersize').supersized();
    	    });
    }
    add_action('wp_head', 'supersized_script');?>

    Thanks,
    Leslie

    Posted 4 years ago #
  2. Anyone? I know this topic has been covered a lot and I read everything but I'm missing something probably very basic and can't make this work. I would REALLY appreciate it if someone could take a look!

    Thanks,
    Leslie

    Posted 4 years ago #
  3. Hi Leslie,

    I think some of your problem is coming from incorrect syntax in those funtcions. Try this. I cleaned it up a bit but It's not been tested:

    <?php
    //JQuery
    function re_init_jQuery() {
    	if (!is_admin()) {
    		wp_deregister_script('jquery');
    		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
    		wp_enqueue_script('jquery');
    	}
    }
    add_action('init', 're_init_jQuery');
    
    //Supersized for homepage
    function supersized_script() {?>
    	<script src="http://dev.jquery.com/view/tags/ui/latest/ui/effects.core.js"></script>
    	<script type="text/javascript" src="/scripts/supersized/supersized.2.0.js"></script>
    	<script type="text/javascript">
    		jQuery(function(){
    			jQuery.fn.supersized.options = {
    				startwidth: 1024,
    				startheight: 768,
    				vertical_center: 1,
    				slideshow: 1,
    				navigation: 1,
    				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
    				pause_hover: 0,
    				slide_counter: 1,
    				slide_captions: 1,
    				slide_interval: 100000
    			};
    	        jQuery('#supersize').supersized();
    	    });
    	</script>
    <?php
    }
    add_action('wp_head', 'supersized_script');?>
    Posted 4 years ago #
  4. You the man! Thank you soooo much.

    Posted 4 years ago #
  5. nvdg
    Member

    I'm confused. where is that code supposed to go?

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.