【发布时间】:2013-06-19 15:22:01
【问题描述】:
我正在构建一个添加了自定义 Tiny MCE 样式的 wordpress 网站,它为用户提供了一个包含锚点的预样式“更多”按钮,该按钮位于帖子的左下方。更多按钮的格式是这样的
<p><span class="moreButton"><a>Link here </a></span></p>.
我的问题是将框设置为动态大小,无论其中有多少文本,并且由于通过 wordpress 帖子输入的按钮样式更多,它包含在我似乎无法释放的 div 中从。
总而言之是这样的:
<div class="newsBoxMore">
<div class="newsBoxMainHolder">
<div class="alumniHeading newsMainHeading">
<h4>21 Years of NCCA Masters</h4>
</div>
<div class="alumniContent newsMainContent">
<p>As a reminder of where we started out this example from 1990 won a special award at the CG90 Festival.</p>
<p>Text in here.</p>
<p><span class="moreButton"><a title="Video" href="" target="_blank">View Here</a></span> </p>
</div><!-- end newsMainContent -->
<div class="newsDateHolder">
<p>POSTED: 16.06.13</p>
</div><!-- end newsDateHolder -->
</div><!-- end newsBoxMainHolder -->
</div><!-- end news Box More -->
我想做的是移动
<p><span class="moreButton"></span></p>
在 newsMainContent div 之外,我希望它位于 newsDateHolder div 上方。我尝试使用以下代码:
$(".newsMainContent span").insertAfter($(".newsMainContent"));
这样做的问题是它与页面上的每个锚点都复制了 moreButton 类。所以我最终得到了一个应该有一个 moreButton 的帖子,但现在它有 10 个,因为该页面显示了 10 个帖子。
任何帮助将不胜感激!
【问题讨论】:
标签: php jquery wordpress tinymce insertafter