用父对象切换父元素
我有这个结构
Integer ac porta felis. ...read more
onsectetur adipiscing elit. Sed condimentum dictum vestibulum. Praesent odio dolor, dapibus et consectetur quis, pulvinar eu orci. Integer ac porta felis. ...read less Integer ac porta felis. ...leer más
onsectetur adipiscing elit. Sed condimentum dictum vestibulum. Praesent odio dolor, dapibus et consectetur quis, pulvinar eu orci. Integer ac porta felis...read less
而且我正在努力
$('.despLeerMas').click(function () { $(this).parent().next('.masInfodespLeerMas').toggle(); $(this).parent().next('.ocultarLeerMas').toggle(); $(this).toggle(); return false; }); $('.ocultarLeerMas').click(function () { $(this).parent().toggle(); $(this).parent().parents('p').find('.despLeerMas').toggle(); ///cant' get it working $(this).toggle(); return false; });
在线: http : //jsfiddle.net/xwQGN/1/
单击.despLeerMas(和.despLeerMas隐藏)时,单击.ocultarLeerMas再次隐藏div时显示隐藏。问题是.despLeerMas不再显示:S(我猜不到选择代码,我猜)
尝试:
$(this).parent().prev().find('.despLeerMas').toggle();
你的更新小提琴。