treehouse : what would you like to learn today?
Web Design Web Development iOS Development

jquery problem

  • problem in jquery code and body told me what is the problem in this two code beacuse its two jquery plugin code first one recent post and second one form alert .when i apply two these code at a time in static website then show error on one code

    that is first jquery code

    $(function(){
      $('#news-container').vTicker({ 
        speed: 1300,
        pause: 5000,
        animation: 'fade',
        mousePause: true,
        showItems: 9
      });
    
    });
    

    and that is second

    window.addEvent('domready', function(){
      var myFormValidation = new Validate('myForm',{
        errorClass: 'red'
      });
    });
    
  • Hi zahidahmad9!

    Could you be more specific about the error. What does it say?

    It would be even better if you shared a link to the site having this error.

  • Thanks Mottie for helps

    This is my website link http://psdmafia.com/request.html if you will see in footer testimonial not working and u can see javascript code in page source

    Again thaks :)

  • I just checked this out and it seems to be working.

  • yes html form alert are working but testimonial slider not working

  • height: 178px

    not sure if that goes in your

     $('#news-container').vTicker({ 
    

    But you may also have to put it in your /js/jquery.vticker-min.js file. I opened that up and saw height: 0...

    I'm not sure of what you need to change... if you put the code into a jsfiddle for me I could mess with it.

    Good luck, please let me know your progress.

    TL;DR - Basically nothing is going on because there is no height set, so the animation of moving the UL isn't happening.

  • HAHA. just looked up vTicker after I looked at the console.

    Uncaught TypeError: Cannot call method 'vTicker' of null

    I'm thinking you are trying to pass stuff to vTicker and you aren't putting enough in it.

    $('.myclass').vTicker({
    speed: 500,
    pause: 3000,
    showItems: 9,
    animation: 'fade',
    mousePause: false,
    height: 178px,
    direction: 'up'
    });