Support » Fixing WordPress » jquery slider not working in wordpress page

  • i have implemented a jquery slider called CarouFredSel. In my simple implementation all that happens is there are for images which are transitioned.

    The problem is that the slider works fine in a standalone php file or if I copy all the html code into a template file in wordpress.

    But when I copy the html code into the html page editor of wordpress, the slider or jquery does not work at all. I need it in the html page editor so that edits can be made to the other aspects of the page.

    The code below is the html which the jquery is supposed to act on

    <section class="partners">
    <div id="partners-slider">
    <div class="slider-holder2">
    <img src="css/images/stat1.png" width="510px" height="52px"/>
    <img src="css/images/stat2.png" width="571px" height="52px"/>
    <img src="css/images/stat3.png" width="514px" height="52px"/>
    <img src="css/images/stat4.png" width="479px" height="52px"/>
    <img src="css/images/stat1.png" width="510px" height="52px"/>
    <img src="css/images/stat2.png" width="571px" height="52px"/>
    <img src="css/images/stat3.png" width="514px" height="52px"/>
    <img src="css/images/stat4.png" width="479px" height="52px"/>
    </div>
    </div>
    <div class="slider-arr">
    <a class="prev-arr arr-btn" href="#"></a>
    <a class="next-arr arr-btn" href="#"></a>
    </div>
    </section>

    A sample of the javascript code that is supposed to fire is below
    `$(‘#partners-slider .slider-holder2’).carouFredSel({

    align: ‘center’,

    items: {

    visible: “variable”,

    width: “variable”

    },

    scroll: 1,

    prev: “.prev-arr”,

    next: “.next-arr”

    });

Viewing 1 replies (of 1 total)
  • If you are using jquery js library or some other js library don’t append directly like
    <script src="path"></script>You must enqueue the script inorder to workable.
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script
    and the second thing if you are using $ as in javascript change it to jQuery
    Sometimes $ is not the function error comesup while integrating wordpress.

    Another method also available

    jQuery(document).ready(function($) {
    
    $('#someid').click(function() {
    // something goes here.
    });
    });

Viewing 1 replies (of 1 total)
  • The topic ‘jquery slider not working in wordpress page’ is closed to new replies.