私が見つけた崩壊するテキストjqueryプラグインのトランジションを作成する際に問題があります。 Unfortunatley私はほとんどjavascriptへの理解を行った。一番下に「& &(this).show( 'fast');」と追加しました。しかしそれはうまくいかなかった。うまくいけばあなたが助けることができます。jqueryの拡張テキストにJavaScriptのトランジションを追加するには?
$(document).ready(function() {
var maxheight=16;
var showText="Weiterlesen";
var hideText="Zusammenklappen";
$('.expand').each(function() {
var text = $(this);
if (text.height() > maxheight){
text.css({ 'overflow':'hidden','height': maxheight + 'px' });
var link = $('<p class="weiter" id="noselect"><a>' + showText + '</a></p>');
var linkDiv = $('<div></div>');
linkDiv.append(link);
$(this).after(linkDiv);
link.click(function (event) {
event.preventDefault();
if (text.height() > maxheight) {
$(this).html('<a>' + showText + '</p>');
text.css('height', maxheight + 'px')
&&(this).show('fast');
} else {
$(this).html('<a>' + hideText + '</p>');
text.css('height', 'auto')
&&(this).show('fast');
}
});
}
});
});
&&を削除してください。それはそれを使用する意味がありません –