开发者

What is wrong with my jQuery / my JS?

I just started working on the following site: http://www.psykotaktyle.com/

I have downloaded the latest jQuery (1.6.2) and jQuery UI (1.8.14).

The only other JS code on the page is:

function get_url_param(param, url) {
  param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+param+"=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(url);
  if( results == null )
    return '';
  else
    return results[1];
}

$(document).ready(function() {
  $('ul.menu li').click(function() {
    var href = $('a', this).attr('href');
    var content = get_url_param('page', href);
    if (!content) content = 'home';

    $('.slide-item').animate({top:'1000开发者_开发知识库px'}, 500)

    //$('#content').fadeOut();

    //alert(content);

    return false;
  });
});

For some reason I get a JS error on the page when clicking on a menuitem.

Uncaught TypeError: Not enough arguments jQuery-1.6.2.min.js:18

I don't have a clue what went wrong here so I hope someone can tell me what is causing this error.


Just ran into this same problem and it is Chrome related. Error is occurring with the combination of the current Chrome Canary Channel (15), jQuery 1.6.2, and an animation call.


Nothing wrong with that code. It's working

Check this fiddle.

http://jsfiddle.net/3TDch/

JUST realized :-) Add position:absolute; to your slider-item.

EDIT BY OP

Sorry to hijack your answer avetarman :)

The issue was indeed the latest Chrome version (v15).

I've just tested with v12 and it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜