小编sup*_*per的帖子

JQuery嵌套可排序手风琴

我正在使用http://mjsarfatti.com/sandbox/nestedSortable/ Nested Sortables for JQuery.我想让每个可嵌套的手风琴.我已经达到了嵌套可排序和手风琴的程度; 但是,每当我将任何可排序项拖到左侧时,整个应用程序就会冻结.

这是我的JS(运行正常):

$('ol.sortable').nestedSortable({
    disableNesting: 'no-nest',
    forcePlaceholderSize: true,
    handle: 'div',
    helper: 'clone',
    items: 'li',
    maxLevels: 10,
    opacity: .6,
    placeholder: 'placeholder',
    revert: 250,
    tabSize: 25,
    tolerance: 'pointer',
    toleranceElement: '> div'                   
});

$(function() {
    var stop = false;
    $( "#accordion h3" ).click(function( event ) {
         if ( stop ) {
            event.stopImmediatePropagation();
            event.preventDefault();
            stop = false;
            }
    });
    $( "#accordion" )
            .accordion({
            header: "> ol > li > div > h3"
    })
            .nestedSortable({
            axis: "y",
            handle: "h3",
            stop: …
Run Code Online (Sandbox Code Playgroud)

jquery accordion

8
推荐指数
1
解决办法
2101
查看次数

在python lxml中查找前缀标签的提示?

我正在尝试使用lxml的ElementTree etree在我的xml文档中查找特定标记.标签如下所示:

<text:ageInformation>
    <text:statedAge>12</text:statedAge>
</text:ageInformation>
Run Code Online (Sandbox Code Playgroud)

我希望使用etree.find('text:statedAge'),但该方法不喜欢'text'前缀.它提到我应该在前缀地图中添加"文本",但我不确定如何做到这一点.有小费吗?

编辑:我希望能够写入hr4e前缀标签.以下是该文件的重要部分:

<?xml version="1.0" encoding="utf-8"?>
<greenCCD xmlns="AlschulerAssociates::GreenCDA" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hr4e="hr4e::patientdata" xsi:schemaLocation="AlschulerAssociates::GreenCDA green_ccd.xsd">
  <header>
    <documentID root="18c41e51-5f4d-4d15-993e-2a932fed720a" />
    <title>Health Records for Everyone Continuity of Care Document</title>
    <version>
  <number>1</number>
</version>
<confidentiality codeSystem="2.16.840.1.113883.5.25" code="N" />
<documentTimestamp value="201105300211+0800" />
<personalInformation>
  <patientInformation>
    <personID root="2.16.840.1.113883.3.881.PI13023911" />
    <personAddress>
      <streetAddressLine nullFlavor="NI" />
      <city>Santa Cruz</city>
      <state nullFlavor="NI" />
      <postalCode nullFlavor="NI" />
    </personAddress>
    <personPhone nullFlavor="NI" />
    <personInformation>
      <personName>
        <given>Benjamin</given>
        <family>Keidan</family>
      </personName>
      <gender codeSystem="2.16.840.1.113883.5.1" code="M" />
      <personDateOfBirth value="NI" />
      <hr4e:ageInformation>
        <hr4e:statedAge>9424</hr4e:statedAge>
        <hr4e:estimatedAge>0912</hr4e:estimatedAge>
        <hr4e:yearInSchool>1</hr4e:yearInSchool>
        <hr4e:statusInSchool>attending</hr4e:statusInSchool>
      </hr4e:ageInformation>
    </personInformation>
    <hr4e:livingSituation>
      <hr4e:homeVillage>Putney</hr4e:homeVillage> …
Run Code Online (Sandbox Code Playgroud)

lxml xml-namespaces

3
推荐指数
1
解决办法
2263
查看次数

标签 统计

accordion ×1

jquery ×1

lxml ×1

xml-namespaces ×1