Hyperlink 是否有任何替代“报价”的方法;a href";在html中?I';我的严格意思是;a「;

Hyperlink 是否有任何替代“报价”的方法;a href";在html中?I';我的严格意思是;a「;,hyperlink,Hyperlink,我可以用什么来代替“a”选择器吗。可能是类似于或类似的东西。我试图避免使用“a”。原因是我正在使用jQuery及其代码修改部分中的每个“a”。我想保持一些“a”不变。这就是我所拥有的: HTML: 2012年6月14日-Spotify的Noisettes 我们为Spotify公司的Noisettes音乐会提供了音响设备。请欣赏。 JQUERY: $(document).ready(function(){ var $posts = $('#items > div'); var max

我可以用什么来代替“a”选择器吗。可能是类似于
或类似的东西。我试图避免使用“a”。原因是我正在使用jQuery及其代码修改部分中的每个“a”。我想保持一些“a”不变。这就是我所拥有的: HTML:


2012年6月14日-Spotify的Noisettes

我们为Spotify公司的Noisettes音乐会提供了音响设备。请欣赏。

JQUERY:

$(document).ready(function(){
var $posts = $('#items > div');
var maxHeight = 32;

$('a', $posts).live('click', function(){
    var $par = $(this).prev('p');

    var oH = parseInt($par.attr('class'));

    if($par.height() == oH){
        $par.animate({
            'height': maxHeight
        }, 'medium');
        $(this).text('read more...');
    }else{
        $par.animate({
            'height': oH
        }, 'medium');
        $(this).text('read less...');
    }
});

$posts.each(function(){
    if($('p', this).height() > maxHeight){

        $('p', this)
            .attr('class', $('p', this).height())
            .css('height', maxHeight+'px');
        $(this).append($('<a class="link">').text('read more...'));
    }
});     
$(文档).ready(函数(){
var$posts=$(“#items>div”);
var-maxHeight=32;
$('a',$posts).live('click',function()){
var$par=$(this.prev('p');
var oH=parseInt($par.attr('class'));
如果($par.height()==oH){
$par.animate({
“高度”:最大高度
}"中等";;
$(this.text('readmore…');
}否则{
$par.animate({
高度:哦
}"中等";;
$(this.text('readless…');
}
});
$posts.each(函数(){
if($('p',this).height()>maxHeight){
$('p',本)
.attr('class',$('p',this).height())
.css('height',maxHeight+'px');
$(this.append($('').text('readmore…');
}
});     
}))

它将我的“YouTube上的Noisettes”(来自html代码)替换为“Readless…”(仍在工作,但措辞有所改变。我曾尝试使用CSS,但它仍在替换它)。
我希望我在这一点上说得很清楚:)提前感谢您的帮助。

给出您想要更改特定类的所有“a”,说“changable”,然后将选择器从
$('a',$posts)
更改为
$('a.changable',$posts)
您应该使用更具体的选择器:

$posts.find('a.SomeClass')...

然后将您希望此应用的链接更改为

问题是这些“a”在html中不存在。只有当特定的帖子更大时,jQuery才会使用它们。所以我不能向这些元素添加任何类。如果我理解的很好。看起来他们给了这个类一个“链接”,所以使用
$('a.link',$posts)
$posts.find('a.SomeClass')...