我有一个设置为的div图层.overflowscroll
当滚动到底部时div,我想运行一个函数.

There are 2 functions involved.
$array = array("first", "second", "third", "fourth");
foreach($array as $i=> $string) {
if(stristr($string, "e")) {
unset($array[$i]);
}
}
Run Code Online (Sandbox Code Playgroud)
second是具有字符"e"的数组项.如果它unset,$array[1]将留空:
$array[0] = "first"
$array[1] = ""
$array[2] = "third"
$array[3] = "fourth"
Run Code Online (Sandbox Code Playgroud)
我想$array[1]从阵列(如在除去array_shift()),从而使third需要的地方second和fourth的地方third:
$array[0] = "first"
$array[1] = "third"
$array[2] = "fourth"
Run Code Online (Sandbox Code Playgroud) 我的班级以外有一个全局变量= $ MyNumber;
如何在myClass中将其声明为属性?
对于我班上的每一个方法,我都是这样做的:
class myClass() {
private function foo() {
$privateNumber = $GLOBALS['MyNumber'];
}
}
Run Code Online (Sandbox Code Playgroud)
我要这个
class myClass() {
//What goes here?
var $classNumber = ???//the global $MyNumber;
private function foo() {
$privateNumber = $this->classNumber;
}
}
Run Code Online (Sandbox Code Playgroud)
编辑:我想基于全局$ MyNumber创建一个变量,但
在方法中使用它之前进行了修改
类似于:var $ classNumber = global $ MyNumber + 100;
我需要一个按下按钮时执行功能的功能,当按钮松开时我停止执行
$('#button').--while being held down--(function() {
//execute continuously
});
Run Code Online (Sandbox Code Playgroud) 如何将一个或多个页面的页面内容包含在另一个页面中?
恩.我有pageA,pageB和pageC,我想在pageX中包含这些页面的内容
是否有一个wordpress函数加载指定页面/帖子的帖子?
喜欢show_post("pageA")??
$(element)[0].selectionStart似乎只适用于textareas.是否有替代非textareas
我试图在标签中的DOM元素中包装字符串(粗体,斜体......)
另外,如何撤消包装?
我想了解tinymce的功能.
富文本编辑器在iframe中包含html文档.如何将嵌套的DOM元素放在可编辑的内部,换句话说,当没有涉及textarea或输入字段时,我怎么能在一个<div>或一个<p>图层内键入(至少我看不到任何内容)?
是活动时转换为输入字段的元素?
编辑:如果你要对这个问题进行投票,请说明原因.
如何使用regex(preg_replace)删除字符串末尾的额外空格?
$string = "some random text with extra spaces at the end ";
Run Code Online (Sandbox Code Playgroud) 此函数使用范围对象返回用户选择并将其包装为粗体标记.有没有一种方法可以删除标签?如在<b>text<b> = text.
我实际上需要一个切换功能,它将选择包装在标签中,如果已经包含标签,则将其解包.与切换粗体按钮时文本编辑器的操作类似.
if "text" then "<b>text</b>"
else "<b>text</b>" then "text"
Run Code Online (Sandbox Code Playgroud)
...
function makeBold() {
//create variable from selection
var selection = window.getSelection();
if (selection.rangeCount) {
var range = selection.getRangeAt(0).cloneRange();
var newNode = document.createElement("b");
//wrap selection in tags
range.surroundContents(newNode);
//return the user selection
selection.removeAllRanges();
selection.addRange(range);
}
}
Run Code Online (Sandbox Code Playgroud) function selected() {
var selObj = window.getSelection();
}
Run Code Online (Sandbox Code Playgroud)
此函数返回网页中的选定文本.如何返回所选区域的html.这可能与标签<img>和<a>标签有关吗?
以下是功能列表:https://developer.mozilla.org/Special :
Tags?tag = DOM&languageUen
javascript ×6
jquery ×5
php ×4
dom ×2
html ×2
arrays ×1
class ×1
click ×1
execcommand ×1
methods ×1
mouse ×1
regex ×1
scroll ×1
scrollbar ×1
string ×1
text-editor ×1
tinymce ×1
variables ×1
whitespace ×1
wordpress ×1