https://jqueryui.com/droppable/
找一个喜欢的样式
<script>
$(function () {
$("#draggable").draggable();
$("#droppable").droppable({
drop: function (event, ui) {
$(this).addClass("ui-state-highlight").find("p").html("Dropped!");
},
});
});
</script>
API Documentation > (左侧) Interactions > Draggable Widget
https://api.jqueryui.com/draggable/
API Documentation > (左侧) Interactions > Droppable Widget
https://api.jqueryui.com/droppable/
新增 找到可使用的地方 +「,」 继续使用
drop: function (event, ui) {
// 自己改颜色
$(this).addClass("green").find("p").html("apple");
// 或
//.css('backgroundColor', 'green')
}, // 新增 找到可使用的地方 +, 继续使用(记得把function ()变数删除)
out: function () {
$(this).find("p").html("移出去了");
}, // 新增 找到可使用的地方 +, 继续使用(记得把function ()变数删除)
over: function () {
$(this).find("p").text("移进来了");
},
drop: function (event, ui) {
// 想知道event,看一下
console.log(event); //target: div#droppable.ui-widget-header.ui-droppable
// 想知道 ui,看一下
console.log(ui); //找到{draggable:}这个位置
console.log(ui.draggable); //可以看是哪一层(游标指过去)
//0: div.draggable.ui-widget-content.ui-draggable.ui-draggable-handle
ui.draggable.hide();
点了就会把这个类别放上去因此换色
#apple .ui-selected {
background: #2314f3;
color: white;
}
类别直接拿来用! 就不用再写选定谁
var temp = $("#apple .ui-selected").text(); // 'apple';
console.log(temp);
$("#mySelected").text(temp);
https://api.jqueryui.com/datepicker/
https://jqueryui.com/datepicker/#date-range
$(function () {
var dateFormat = "yy/mm/dd", //被抓
from = $("#from")
.datepicker({
defaultDate: "+1w", //一周
changeMonth: true, //
numberOfMonths: 3,
// 属性 : 设定
changeYear: true, //开启年份下拉
yearRange: "c-1:c+2", //设定年分 系统年-1~+2年
dateFormat: dateFormat,
//设定日历格式 会回去抓"yy/mm/dd"
//JQ给的dateFormat:自己写的dateFormat
})
$("#red, #green, #blue").slider({
orientation: "horizontal", //横向
range: "min", //max
max: 255, // (o)
value: 127,
// slide: refreshSwatch, //1.slide: 被後盖前,无效而方框不会变色
//把上面范例 卷轴里面有数字↓↓↓↓↓↓ code拿来用
create: function () {
//范例只有一个,但此时有三个#red, #green, #blue"
//使用this(这个)
$(this).find(".custom-handle").text($(this).slider("value"));
},
slide: function (event, ui) {
refreshSwatch(); //2.把前面的refreshSwatch搬过来,+()执行
$(this).find(".custom-handle").text(ui.value);
console.log(ui);
},
change: function (event, ui) {
// 滑动中会跟着变色
refreshSwatch();
console.log("change");
console.log(this);
$(this).find(".custom-handle").text(ui.value);
},
.animate()在Jq不能改背景色,跟UI有各自的分工
https://api.jquery.com/animate/#animate-properties-duration-easing-complete
(For example, width, height, or left can be animated but background-color cannot be,
unless the jQuery.Color plugin is used).
https://api.jqueryui.com/show/
https://jqueryui.com/show/
function runEffect() {
$("#effect").show("explode", { }, 500,callback);
}
2-1.从文件得知样式的的属性变更在第二格(options)
.show( effect [, options ] [, duration ] [, complete ] )
2-2.搜寻explode-effect,选择喜欢的贴上
https://api.jqueryui.com/explode-effect/
function runEffect() {
$("#effect").show("explode", { pieces: 4 }, 500,callback);
}
<<: Palo Alto Networks PSE-Strata Dumps - 让 PSE-Strata 考试成为无压力考试
>>: RISC-V on Rust 从零开始(4) - Rust 测试工具
30 天的填坑之旅终於结束了 ...(›´ω`‹ ) 不知道大家觉得如何呢? 第一次挑战将主题分成 ...
使用 Firebase 专案串接 GA4 资源,提升 App 绩效 过往无法一探究竟的技术过程,现在...
Windows Arm 的影片剪辑 虽然很多图像工作者都使用 Mac 来作为主力的开发机,但也有很多...
上上篇已经写了一个Flask API的Hello World, 现在我们的Flask API要开始串...
早期还在当工程师的时候,每次碰到一些自己没兴趣,或者自己的价值判断觉得不合理的东西,就会下意识的亮出...