私はそのようなJavaScriptを持っています
$.fn.hasBorder = function() {
if ((this.outerWidth() - this.innerWidth() > 0) || (this.outerHeight() - this.innerHeight() > 0)){
return true;
}
else{
return false;
}
};
function removeImage(){
$(document).ready(function() {
var selectedImgsArr = [];
$("img").click(function() {
if($(this).hasBorder()) {
$(this).css("border", "");
//you can remove the id from array if you need to
}
else {
$(this).css("border", "1 px solid red");
selectedImgsArr.push($(this).attr("id")); //something like this
alert(selectedImgsArr);
}
});
このスクリプトを自分のページにロードします。このスクリプトを使用するには
私はこれを書いた
div load="removeImage">
何が機能しないのですか?