读书人

有没有帮小弟我看看这2段js哪里有冲

发布时间: 2012-08-29 08:40:14 作者: rapoo

有没有帮我看看这2段js,哪里有冲突吗
$(function() {

// Set up variables
var $el, $parentWrap, $otherWrap,
$allTitles = $("dt").css({
"cursor": "pointer" // make it seem clickable
}),
$allCells = $("dd").css({
position: "relative",
top: -1,
left: 0,
display: "none" // info cells are just kicked off the page with CSS (for accessibility)
});

// clicking image of inactive column just opens column, doesn't go to link
$("#page-wrap").delegate("a","click", function(xx) {

if ( !$(this).parent().hasClass("curCol") ) {
xx.preventDefault();
$(this).next().find('dt:first').click();
}

});

// clicking on titles does stuff
$("#services").delegate("dt", "click", function() {

// cache this, as always, is good form
$el = $(this);

// if this is already the active cell, don't do anything
if (!$el.hasClass("current")) {

$parentWrap = $el.parent().parent();
$otherWraps = $(".info-col").not($parentWrap);

// remove current cell from selection of all cells
$allTitles = $("dt").not(this);

// close all info cells
$allCells.slideUp();

// return all titles (except current one) to normal size
$allTitles.animate({
fontSize: "14px",
paddingTop: 0,
paddingBottom: 0
});

// animate current title to larger size
$el.animate({
"font-size": "20px",
paddingTop: 5,
paddingBottom: 5
}).next().slideDown();

// make the current column the large size
$parentWrap.animate({
width: 310
}).addClass("curCol");

// make other columns the small size
$otherWraps.animate({
width: 190
}).removeClass("curCol");

// make sure the correct column is current
$allTitles.removeClass("current");
$el.addClass("current");

} else {
$allCells.slideUp();
$el.animate({
fontSize: "14px",
paddingTop: 0,
paddingBottom: 0
});
$parentWrap.animate({
width: 220
}).removeClass("curCol");
$otherWraps.animate({
width: 220
}).removeClass("curCol");
$el.removeClass("current");
}

});

$("#starter").trigger("click");



});

[解决办法]

探讨
我把第一段的$替换成Jquery 可以通过了

[解决办法]
在火狐浏览器里面跑下 看下什么错误

读书人网 >Java Web开发

热点推荐