在这里,我们将给大家分享关于如何使用jQuery(wordpress)在多个div之间插入?的知识,让您更了解js给div添加多个样式怎么写的本质,同时也会涉及到如何更有效地bash–在多个(新)选项
在这里,我们将给大家分享关于如何使用 jQuery (wordpress) 在多个 div 之间插入
- 如何使用 jQuery (wordpress) 在多个 div 之间插入
- bash – 在多个(新)选项卡中打开现有Gvim中的文件
- DIV 重叠 CSS 让 DIV 层叠 两个 DIV 或多个 DIV 顺序重叠加
- Excel VBA - 在多个 Word 实例之一中打开 Word 文档
- GitHub Actions 在多个 tox-runs 之间访问 python 包工件
如何使用 jQuery (wordpress) 在多个 div 之间插入 ?(js给div添加多个样式怎么写)
如何解决如何使用 jQuery (wordpress) 在多个 div 之间插入 <div> </div>?
我需要在一行中生成第 3 类和第 4 类。
我遵循现有代码,并尝试使用 append 在两个 div 之间添加,
但它没有在 div 之间插入 div。
你能告诉我如何将第 3 类和第 4 类放在一行中吗?
使用插件生成的现有代码(第 3 类和第 4 类显示在两行中):
<form class="acfef-form">
<div class="1"></div>
<div class="2"></div>
<div class="3">
<div class="3-1"><input class="acfef-submit-button" type="submit"></div>
</div>
<div class="4"><input class="save-progress-button" name="save_progress" type="submit"></div>
</form>
我想这样做:
<form class="acfef-form">
<div class="1"></div>
<div class="2"></div>
<div>
<div class="3">
<div class="3-1"><input class="acfef-submit-button" type="submit"></div>
</div>
<div class="4"><input class="save-progress-button" name="save_progress" type="submit"></div>
</div>
</form>
谢谢。
解决方法
正如 charlietfl 所建议的,您可以使用 wrapAll
来实现此目的。此外,其他方式将使用 prev().addBack().wrapAll()
这将从您的保存进度中获取前一个元素,然后将它们包装在一个 div 中。
演示代码:
//$("form.acfef-form .acf-form-submit,.save-progress-buttons").wrapAll("<divabc''></div>")
//or
$("form.acfef-form .save-progress-buttons:last").prev().addBack().wrapAll("<divabc'' />");
.abc {
display: flex;
}
.abc>div {
margin: 10px;
padding: 10px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<form class="acfef-form -submit" action="" method="post" autocomplete="disableacf" novalidate="novalidate" data-widget="fc7226d" id="acf-form-fc7226d12597" enctype="multipart/form-data">
<div class="acf-form-data acf-hidden">
<input type="hidden" name="_acf_screen" value="acfef_form"><input type="hidden" name="_acf_post_id" value="12597"><input type="hidden" name="_acf_nonce" value="fb285841f9"><input type="hidden" name="_acf_validation" value="1"><input type="hidden"
name="_acf_changed" value="0"><input type="hidden" name="_acf_status" value=""><input type="hidden" name="_acf_form" value="QzNx"><input type="hidden" name="_acf_main_action" value="edit_post"><input type="hidden" name="_acf_screen_id" value="3358">
<input type="hidden" name="_acf_element_id" value="fc7226d"> </div>
<div class="acf-fields acf-form-fields -top">
<div class="acf-field acf-field-product-title acf-field-6053b2640eef9 elementor-repeater-item-b95d154" data-name="title" data-type="product_title" data-key="field_6053b2640eef9">
<div class="acf-label">
</div>
<div class="acf-field acf-field-textarea acf-field-60bc51af899c4 elementor-repeater-item-b95d154" data-name="extra-request" data-type="textarea" data-key="field_60bc51af899c4">
<div class="acf-label">
<label for="acf-field_60bc51af899c4">ETC</label></div>
<div class="acf-input">
<textarea id="acf-field_60bc51af899c4" name="acf[field_60bc51af899c4]" rows="8"></textarea></div>
</div>
</div>
</div>
<div class="acf-form-submit">
<div class="acfef-submit-buttons"><input type="submit" class="acfef-submit-button acf-button button button-primary" data-state="publish" value="Submit"></div>
</div>
<div class="save-progress-buttons">
<input formnovalidate="" type="submit" class="save-progress-button acf-submit-button acf-button button" value="Save Draft" name="save_progress" data-state="revision"></div>
</form>
bash – 在多个(新)选项卡中打开现有Gvim中的文件
gvim -p <list of file names using absolute paths>
这是好和好,除了有几组文件,我可能想在任何给定时间之间移动(我当前的项目使用Ruby on Rails,因此解释)。真正真棒的是,如果我可以将新的选项卡附加到现有的gvim实例。在我最后的位置,我在Vista上工作;我通过在gvim中打开一堆空标签,让我右键单击文件名并选择“在现有的无名gvim中打开”。现在我使用Ubuntu和上下文菜单上没有这样的东西。有没有办法从命令行做到这一点?
$ gvim --servername GVIM # GVIM is the server name. It can be anything.
要在此实例中打开更多选项卡,可以运行以下命令:
$ gvim --servername GVIM --remote-tab file1 file2 file3 ...
vim中的clientserver特性非常方便。它不限于打开文件;它可以用于使用命令行向vim发送任何命令。例如,要远程关闭vim实例,可以使用:
$ gvim --servername GVIM --remote-send '<Esc>:wqa<CR>'
DIV 重叠 CSS 让 DIV 层叠 两个 DIV 或多个 DIV 顺序重叠加
http://www.divcss5.com/shili/s587.shtml
Excel VBA - 在多个 Word 实例之一中打开 Word 文档
如何解决Excel VBA - 在多个 Word 实例之一中打开 Word 文档
我搜索了高低,以下代码是我最接近我的目标的代码。
这就是我的工作:
我写了一些代码(好吧,老实说,主要是复制零碎的部分并粘贴到可能有效的混乱代码中)通过电子邮件将文档发送给我的学生。如果文档是打开的,我会得到并出错,这允许我手动保存和关闭文档(感谢调试),然后继续。我想自动执行此操作,但 Word 通过在单独的实例中打开每个文档似乎使事情变得有点困难。我可以获得一个实例及其文档,但如果它不是我需要的,我将无法保存和关闭它。我找到了如何获取其他实例,但我还没有找到如何检查每个实例以查看它打开的文档是否是我想要的文档。
我在 (Check if Word instance is running) 中使用了 ZeroKelvin 的 UDF,我对其进行了一些修改...
Dim WMG As Object,Proc As Object
Set WMG = Getobject("winmgmts:")
For Each Proc In WMG.InstancesOf("win32_process")
If UCase(Trim(Proc.Name)) = "WINWORD.EXE" Then
*''Beginning of my code...*
*''This is what I need and have no idea how to go about*
Dim WdApp as Word.Application,WdDoc as Object
*'' is it better to have WdDoc as Document?*
set WdDoc = '' ### I do not kNow what goes here ...
If WdDoc.Name = Doc2Send Or WdDoc.Name = Doc2SendFullName Then
*'' ### ... or how to properly save and close*
WdApp.Documents(Doc2Send).Close (wdPromptToSaveChanges)
Exit For
End If
*''... end of my code*
Exit For
End If
Next ''Proc
Set WMG = nothing
感谢您的时间和努力。
干杯
解决方法
您可能想考虑控制创建的 Word 应用程序实例的数量。下面的函数从 Excel 调用,将返回现有的 Word 实例或仅在不存在的情况下创建一个新的实例。
Private Function GetWord(ByRef WdApp As Word.Application) As Boolean
'' 256
'' return True if a new instance of Word was created
Const AppName As String = "Word.Application"
On Error Resume Next
Set WdApp = GetObject(,AppName)
If Err Then
Set WdApp = CreateObject(AppName,"")
End If
WdApp.Visible = True
GetWord = CBool(Err)
Err.Clear
End Function
该函数是为早期绑定而设计的,这意味着您需要添加对 Microsoft Word 对象库的引用。在开发过程中,最好以这种方式工作。在您的代码完全开发和测试之后,您可以更改为后期绑定。
请注意行 WdApp.Visible = True
。我添加它是为了证明可以修改对象。 If Err
括号内所做的修改仅适用于新创建的实例。无论 WdApp
是如何创建的,它都会适用于我放置的位置。
下一个过程演示如何在您的项目中使用该函数。 (您可以按原样运行它。)
Sub Test_GetWord()
'' 256
Dim WdApp As Word.Application
Dim NewWord As Boolean
Dim MyDoc As Word.Document
NewWord = GetWord(WdApp)
If NewWord Then
Set MyDoc = WdApp.Documents.Add
MsgBox "A new instance of Word was created and" & vbCr & _
"a document added named " & MyDoc.Name
Else
MsgBox "Word is running and has " & WdApp.Documents.Count & " document open."
End If
End Sub
如您所见,变量 WdApp
在此处声明并传递给函数。该函数为其分配一个对象并返回该对象之前是否存在的信息。如果实例已创建,我将使用此信息关闭该实例,如果用户在运行宏之前将其打开,则将其保持打开状态。
这两个消息框仅用于演示。您可以使用它们占用的逻辑空间来做其他事情。而且,是的,我更愿意将我正在查看的实例中的每个文档分配给一个对象变量。在使用早期绑定时,您将获得 Intellisense 的额外好处。
编辑
您的过程会枚举进程。我无法找到确定将流程转换为应用程序实例的方法。换句话说,您可以枚举进程并找出正在运行的 Word 实例的数量,但我无法将这些实例中的任何一个转换为应用程序的特定功能实例,以便访问其中打开的文档。因此,我决定枚举窗口,然后从那里返回到文档。下面的函数专门省略了隐形打开的文档。
Option Explicit
Private Declare PtrSafe Function apiGetClassName Lib "user32" Alias _
"GetClassNameA" (ByVal Hwnd As Long,_
ByVal lpClassname As String,_
ByVal nMaxCount As Long) As Long
Private Declare PtrSafe Function apiGetDesktopWindow Lib "user32" Alias _
"GetDesktopWindow" () As Long
Private Declare PtrSafe Function apiGetWindow Lib "user32" Alias _
"GetWindow" (ByVal Hwnd As Long,_
ByVal wCmd As Long) As Long
Private Declare PtrSafe Function apiGetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal Hwnd As Long,ByVal _
nIndex As Long) As Long
Private Declare PtrSafe Function apiGetWindowText Lib "user32" Alias _
"GetWindowTextA" (ByVal Hwnd As Long,ByVal _
lpString As String,ByVal aint As Long) As Long
Private Const mcGWCHILD = 5
Private Const mcGWHWNDNEXT = 2
Private Const mcGWLSTYLE = (-16)
Private Const mcWSVISIBLE = &H10000000
Private Const mconMAXLEN = 255
Sub ListName()
'' 256
'' adapted from
'' https://www.extendoffice.com/documents/excel/4789-excel-vba-list-all-open-applications.html
Dim xStr As String
Dim xStrLen As Long
Dim xHandle As Long
Dim xHandleStr As String
Dim xHandleLen As Long
Dim xHandleStyle As Long
Dim WdDoc As Word.Document
Dim Sp() As String
On Error Resume Next
xHandle = apiGetWindow(apiGetDesktopWindow(),mcGWCHILD)
Do While xHandle <> 0
xStr = String$(mconMAXLEN - 1,0)
xStrLen = apiGetWindowText(xHandle,xStr,mconMAXLEN)
If xStrLen > 0 Then
xStr = Left$(xStr,xStrLen)
xHandleStyle = apiGetWindowLong(xHandle,mcGWLSTYLE)
If xHandleStyle And mcWSVISIBLE Then
Sp = Split(xStr,"-")
If Trim(Sp(UBound(Sp))) = "Word" Then
ReDim Preserve Sp(UBound(Sp) - 1)
xStr = Trim(Join(Sp,"-"))
Set WdDoc = Word.Application.Documents(xStr)
'' this applies if the document was not saved:-
If WdDoc.Name <> xStr Then Set WdDoc = GetObject(xStr)
Debug.Print xStr,Debug.Print WdDoc.Name
End If
End If
End If
xHandle = apiGetWindow(xHandle,mcGWHWNDNEXT)
Loop
End Sub
请注意,将 API 函数放在模块顶部很重要 - 上面没有代码。您的问题不涉及您想对文件做什么,但您希望将它们列出来,这已经完成。
GitHub Actions 在多个 tox-runs 之间访问 python 包工件
如何解决GitHub Actions 在多个 tox-runs 之间访问 python 包工件
按照 tox 的文档,我应该能够在不同的 tox 运行之间share artefacts。虽然我在本地工作,但无法通过 GitHub 操作使其工作。
tox.ini
[tox]
envlist = py38
toxworkdir = {toxinidir}/../.tox/pandas_ml_utils
[testenv]
setenv =
TOX_KERNEL = pd_utils_tox
__VERSION__ = 0.2.0
deps =
# does not work (the documented way)
{distshare}/pandas-ml-common-*.zip
-rdev-requirements.txt
commands =
python -m ipykernel install --user --name {env:TOX_KERNEL} --display-name "{env:TOX_KERNEL} py38"
python -m unittest discover
# does not work either (workaround working locally)
#commands_pre =
# python -m pip install "{distshare}/pandas-ml-common-{env:__VERSION__}.zip"
commands_post =
python tox_clean_egg.py
pythonpackage.yml
# This workflow will install Python dependencies,run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
env:
LD_LIBRARY_PATH: ''/tmp/lib:/usr/lib:/usr/local/lib/''
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: pip install -U tox
- name: execute tox tests on COMMON
working-directory: pandas-ml-common
run: tox -e py
- name: execute tox tests on ML_UTILS
working-directory: pandas-ml-utils
run: tox -e py
编辑
我发现一个问题是需要修复版本并且通配符无法按文档工作。如果我使用:
deps =
{distshare}/pandas-ml-common-{env:__VERSION__}.zip
然后我更进一步,但是 setup.py 失败了:
错误:找不到满足 pandas-ml-common==0.2.0 要求的版本
setup.py
setup(
name=os.path.basename(os.path.dirname(os.path.abspath(__file__))),version=__version__,author=''KIC'',author_email='''',packages=find_packages(),scripts=[],url=url,license=''MIT'',description=__doc__,long_description=''\\n''.join([fix_github_links(l) for l in open(''Readme.md'').readlines()]),long_description_content_type=''text/markdown'',install_requires=[f"pandas-ml-common=={__version__}",*open("requirements.txt").read().splitlines()],extras_require={
"dev": open("dev-requirements.txt").read().splitlines(),},include_package_data=True,classifiers=[
# Chose either "3 - Alpha","4 - Beta" or "5 - Production/Stable" as the current state of your package
''Development Status :: 3 - Alpha'',''Intended Audience :: Developers'',''Topic :: Software Development :: Build Tools'',''License :: OSI Approved :: MIT License'',''Programming Language :: Python :: 3'',''Programming Language :: Python :: 3.7'',],keywords=[''pandas'',''ml'',''util'',''quant''],)
我们今天的关于如何使用 jQuery (wordpress) 在多个 div 之间插入
本文标签: