Method that will be executed after the document is loaded (see jquery documentation)
Generally speaking, all events should be bound when the document is loaded, but there is an exception.
For example, the content retrieved through the Ajax method also contains If it contains action buttons, you need to perform binding for this part of the function.
//You need to manually call the load_event_monitor(element); method.
$(function() {
load_event_monitor(document);
});
//Note that the o object here is An html element rather than a jquery object, so the $(o) function should be used when calling its method
//Convert 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 is relatively simple to use it at the front desk, just write like this:
You can put the title here
here are some main contents
- Hello world
-
hahaha
This experiment was completed on Shaka’s Shenzhou notebook
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31