【发布时间】:2014-01-10 00:01:26
【问题描述】:
你能告诉我有什么方法可以在不使用 jQuery UI 和 jQuery Mobile 的情况下在 jQuery 中左右滑动。实际上有一种方法可以向上滑动和向下滑动。但是没有左右滑动?
【问题讨论】:
标签: jquery
你能告诉我有什么方法可以在不使用 jQuery UI 和 jQuery Mobile 的情况下在 jQuery 中左右滑动。实际上有一种方法可以向上滑动和向下滑动。但是没有左右滑动?
【问题讨论】:
标签: jquery
查看http://jsfiddle.net/Jwkw6/1/
$(function()
{
$('.specialist_pagecontent').eq(0).addClass("active").animate({ left : 0 }, 500);
$('.specialist').click(function() {
$('.specialist_pagecontent').filter(".active").removeClass("active").stop(true).animate({ left : '-100%' }, 500);
$('.selected-specialist').removeClass('selected-specialist');
$(this).addClass('selected-specialist');
$('.specialist_pagecontent').eq($(this).index('.specialist')).addClass("active").stop(true).animate({ left : 0 }, 500);
});
});
希望对你有帮助
【讨论】: