English 中文(简体)
使用 jQuery 从 X 到 Y 项用 jQuery 换行 [关闭]
原标题:Wrap from X to Y items using jQuery [closed]

http://jsbin.com/uxepap/17/edit

我如何用一个 < code@ lt; span 类= " wrap " & gt; & lt;/ span> 将 < / strong > 从第三个链接连接到最后一个 / strong 链接到最后一个 < strong >?

尝试做出修正, 如果它有效, 链接将会在红色背景上加上折叠 。

< parger > 注: 它应该在 a_items var 内包装,然后由 .html (); 显示

<% 1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

最佳回答
问题回答

. wrap 覆盖每个元素 。 使用 < a href=" http:// api.jquery.com/ wrapAll/" rel="nofollow"\\code > wrapAll 覆盖一组元素 :

last.wrapAll( <span></span> );
var links = $( a ).slice(2, $( a ).length);
    links.wrap( <span/> );

jQuery 拥有 < a href=> http://api.jquery.com/slice/" rel=" no follow"\\\\ code>selice () 将您选中的选择从选中的起始索引过滤到选中的可选终点索引 。

这里有一个样本

var last = $( a )       //store them in last
    .slice(2)           //get third to last
    .remove()           //remove them from the DOM
    .wrap( <span> );    //wrap them in span




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签