vSlider not working if I load jQuery

Started 9 months ago by Latest reply from Mr.Vibe
  • This topic is resolved
    1. Anonymous
      Unregistered

      Hi guys, I develop and manage an italian blog called Hymn to Future (www.hymntofuture.com).

      As you can see I have a big slider on the home and a little slider inside the posts/pages.

      Now I want to integrate some effects using jQuery library. When I insert in the header the string <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> to load the library, vSlider stop working correctly.

      It doesn't show anymore post title and excerpts.

      I'm using vSlider 4.1.2 on WP 3.4.1. The theme was developed starting from twentyeleven.

      Thanks in advance.

      Regards

      Davide

      Posted 9 months ago #
    2. Hi,

      You should use wordpress deregister and register to enqueue and include jquery in your theme.

      <?php
      function my_scripts_method() {
          wp_deregister_script( 'jquery' );
          wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
          wp_enqueue_script( 'jquery' );
      }    
      
      add_action('wp_enqueue_scripts', 'my_scripts_method');
      ?>

      Also please increase delay between squares from 300 to 1000ms for cooler effects.

      ( v )

      Posted 9 months ago #
    3. Anonymous
      Unregistered

      Please, can you specify where I have to put that code?

      In my header?

      Anyway thanks, Davide

      Posted 8 months ago #
    4. Anonymous
      Unregistered

      I see that you are loading the included jquery library inside wp-includes.

      I don't get why, if I remove the <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">, my jquery script doesn't work. Shoudln't they work with the jquery call you included in vSlider?

      Posted 8 months ago #
    5. Anonymous
      Unregistered

      Ok I succeded in getting the jquery deregistered and registered (I used the same script you posted).

      But if I activate vSlider my scripts doesn't work again.

      I read that it may be caused by the $ var. Suggestions?

      Posted 8 months ago #
    6. Anonymous
      Unregistered

      Fixed with the code:

      jQuery(function ($) {
      /* You can safely use $ in this code block to reference jQuery */
      });

      Thx for your support ;)

      Posted 8 months ago #
    7. Perfect and Great. +20 points, hope this helps our other users as well.

      ( v )

      Posted 8 months ago #

    Reply

    You must log in to post.