标签:style io os ar strong for sp cti on
1、点击li下面匹配的内容块跟着一起改变
$(".dis-list li").bind("hover click", function () {
$this = $(this);
$this.addClass("active").siblings().removeClass("active");
$(".list-content li.item").eq($this.index()).addClass("on").siblings().removeClass("on");
});
2、升序降序
(function ($) {
$(document).ready(function () {
//调序
$("a[id^=‘ascent-‘]").first().hide();
$("a[id^=‘decline-‘]").last().hide();
//上升
$("a[id^=‘ascent-‘]").click(function (e) {
e.preventDefault();
var tr = $(this).parents("tr:first");
var id = tr.data("id");
var referenceId = tr.prev().data("id");
$.post($(this).attr("href"), { id: id, referenceId: referenceId }, function (data) {
var trBefore = tr.prev();
tr.insertBefore(trBefore);
$("a[id^=‘ascent-‘],a[id^=‘decline-‘]").show();
$("a[id^=‘ascent-‘]").first().hide();
$("a[id^=‘decline-‘]").last().hide();
});
});
//下降
$("a[id^=‘decline-‘]").click(function (e) {
e.preventDefault();
var tr = $(this).parents("tr:first");
var id = tr.data("id");
var referenceId = tr.next().data("id");
$.post($(this).attr("href"), { id: id, referenceId: referenceId }, function (data) {
var trAfter = tr.next();
tr.insertAfter(trAfter);
$("a[id^=‘ascent-‘],a[id^=‘decline-‘]").show();
$("a[id^=‘ascent-‘]").first().hide();
$("a[id^=‘decline-‘]").last().hide();
});
});
});
})(jQuery);
标签:style io os ar strong for sp cti on
原文地址:http://www.cnblogs.com/fangdx/p/3974710.html