Jquery manipulation 操作必须依据dom进行操作。而如果你想在虚拟的dom中进行该操作就会发现显示效果和预先的完全不一致;
正确的方法:
options = $.extend({
"title" : ""
}, options);
var title = $("h1", this).text();
var aLink = $("a", this);
var numOfA = aLink.size();
$(this).empty();
var head = "<div class='lable_title'>" + title + "</div>";
var center = $("<div class=\"nav-1\" />");
var it;
var end = "<span class='cnav_left'></span>";
$(this).append($(head)).append(center).append($(end));
for (var index = 0; index < numOfA; index++) {
it = $(aLink[index]);
var isBr = (index + 1) % 3;
center.append(it);
if (isBr == 0) {
center.append("<br/>");
} else {
center.append("<span>|</span>");
}
}
有问题的:
options = $.extend({
"title" : ""
}, options);
var title = $("h1", this).text();
var aLink = $("a", this);
var numOfA = aLink.size();
$(this).empty();
var head = "<div class='lable_title'>" + title + "</div>";
var center = $("<div class=\"nav-1\" />");
var it;
for (var index = 0; index < aLink.length; index++) {
// $("<span>|</span").insertAfter($(aLink[index]));
it= $(aLink[index]);
if ((index % 3) == 0) {
// $("<br/>").insertAfter($(aLink[index]));
it = it.after("<br/>");
// alert(it.html());
} else {
it = it.after("<span>|</span>");
// alert(it.html());
}
center.append(it);
alert(center.html());
}
// var center=$("<div class=\"nav-1\"
// />").append($(aLink[index]));
var end = "<span class='cnav_left'></span>";
$(this).append($(head)).append(center).append($(end));
分享到:
相关推荐
Low-Cost-UW-Manipulation-iAUV-matlab_rosbag_plot.zip
Learning-pandas-Get-to-grips-with-pandas-a-versatile-and-high-performance-Python-library-for-data-manipulation-analysis-and-discovery.pdf
Image-manipulation-detection 图片篡改检测项目的训练权重,基于tensorflow1.X。 使用VOC2007数据集生成5000张待训练图像使用VGG16预训练权重,使用GPU进行训练,经过40000迭代,得到的权重文件。 已放入百度网盘,...
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API ...
python库。 资源全名:django-dynamic-manipulation-0.0.7.tar.gz
Jquery Dom 操作 这个 webapp 是作为我本科课程的一部分创建的。 可以在查看实时应用程序。
NEVILLE HOGAN 经典阻抗控制论文。机器人控制操作技术初学者必备!!!
week-3-string-manipulation-and-bisection-search-ekarabulut19:GitHub Classroom创建的week-3-string-manipulation-and-bisection-search-ekarabulut19-源码
ImageManipulation是一个简单的Javascript库(无依赖项),可通过以canvas元素替换图像并处理其直接源内容来以某些方式来操作图像。 从许多方面来说,这都是学习如何操作图像和图像数据本身的实验,但是对于支持IE...
We start by configuring and customising the jQuery environment, and getting hands-on with DOM manipulation. Next, we'll explore event handling advanced animations, creating optimised user interfaces, ...
内含缺失软件包,解压至工作空间scr目录下即可
包含了一些数据操作用的函数,当前版本0.1.6。用于建模的数据清洗、重采样 、离散化、计算信息值等操作。拷贝后使用pip3 install + 路径/文件名即可。依赖的包目前为numpy,pandas和pickle,都是常用基础包
Laravel开发-attribute-manipulation 允许使用雄辩模型的属性操纵多个特性。
StringManipulation-9.9.0
前端大厂最新面试题-bit-manipulation.docx
manipulation-2021.0.tar
阻抗控制老文章1-3,在麻省理工某实验室有资源但是不能直接访问,我通过题目猜出了路径找了出来。主要是对阻抗控制的一些参考。本身文章比较老,仿真这东西就不要强求了。
Win平台图片篡改检测的可运行完整代码,只需要anaconda安装必要的tensorflow1.X等库,将数据和权重放入对应的路径即可运行。linux需要编译cython_bbox库即可
Shape Manipulation, Deformation, Image Editing, Mesh Editing, Animation, Interaction
python爱心代码高级python-bit_manipulation.rar