The method to execute after the document is loaded (see jquery documentation)
Generally, when a document is loaded, all events should be bound, except in one case.
For example, the content that is retrieved from the Ajax method contains the action button, which is required to perform the binding for this part of the function.
Copy Code code as follows:
A manual call to Load_event_monitor (element) is required; Method.
$ (function () {
Load_event_monitor (document);
});
Note that the O object here is an HTML element rather than a jquery object, so you should use the $ (O) function when calling its method
Turn it into a jquery object.
Bowtech.init_forder = function (o) {
var Eid = $ (o). attr ("id"). Split ("-") [1];
var fo = $ ("#f-" +eid);
var unfo = $ ("#unf-" +eid);
Fo.click (function () {
$ (O). Hide ();
Unfo.show ();
Fo.hide ();
});
Unfo.click (function () {
$ (O). Show ();
Fo.show ();
Unfo.hide ();
});
}
JQuery.fn.extend ({
Set_caret:function () {
if (!$.browser.msie) return;
var initsetcaret = function () {This.caretpos = Document.selection.createRange (). duplicate ()};
This.click (Initsetcaret). Select (Initsetcaret). KeyUp (Initsetcaret);
},
Insert_caret:function (Textfeildvalue) {
var textobj = this[0];
if (document.all && textobj.createtextrange && textobj.caretpos) {
var Caretpos=textobj.caretpos;
Caretpos.text = caretPos.text.charAt (caretpos.text.length-1) = = "? Textfeildvalue+ ": textfeildvalue;
else if (Textobj.setselectionrange) {
var Rangestart=textobj.selectionstart;
var rangeend=textobj.selectionend;
var tempstr1=textobj.value.substring (0,rangestart);
var tempstr2=textobj.value.substring (rangeend);
TEXTOBJ.VALUE=TEMPSTR1+TEXTFEILDVALUE+TEMPSTR2;
Textobj.focus ();
var len=textfeildvalue.length;
Textobj.setselectionrange (Rangestart+len,rangestart+len);
Textobj.blur ();
} else {
Textobj.value+=textfeildvalue;
}
}
})
It's easier to use the front desk, just write this:
Copy Code code as follows:
<div id= "test2″class=" mod ">
Here you can put the title
<div class= "J Modb A_forder" id= "modb-1002″>
Here are some of the main elements
<dl>
<dt>hello world</dt>
<dd>
Hahaha</dd>
</dl>
This experiment was done on Sharjah's Shenzhou
</div>
<div class= "Edit" >
<a id= "f-1002″class=" Forder "href=" javascript:void (0); " >[]</a> <a id= "Unf-1002″
class= "Unforder" href= "javascript:void (0);" >[unfold]</a>
</div>
</div>
The style is omitted, everyone can write their own, and finally send two effect chart:
What it looks like when it's closed