带cookie保存功能的DIV拖拽效果

使用jQuery实现自定义拖拽功能 本文还有配套的精品资源,点击获取 简介:在网页开发中,拖放功能是增强用户交互体验的重要特性。jQuery简化了DOM操作,提供了实现拖放效果的API。文章将详细介绍如何仅使用jQuery核心库来创建页面元素的拖拽功能,并保存和恢复元素位置。还将探讨如何使用localStorage保存拖动后的位置,以及在实际应用中如何根据需求选择合适的实现方式。 1. jQuery实现... 阅读详情

相信有朋友已经看过本站先前登载的仿Google和Windows Live的拖拽这篇文章,里面的两个DIV拖拽效果除了第一个兼容Firefox火狐浏览器之外,且都不带cookie保存功能,即,当用户重新访问或刷新页面后,所有之前拖拽的DIV都回到原位。

下面这段代码终于支持cookie保存,但页面在Firefox火狐浏览器下面有点变形错乱,可能是xhtml页面结构写得不标准还是怎么的。。。每当这时候自己就想,我到底应该支持哪一家,是IE还是Firefox???

代码转自经典论坛,如需转载请注明出处,谢谢合作!

 

div 拖动+cookie保存 网站个性化 div可以随意拖动 cookie保存! 立即下载

相关推荐

js控制多个div拖拽和拖动、且能保存数据至cookie、数据库、xml

界面好看 效果绚丽 拿来即用 js实现DIV自定义拖拽并且保存的例子 非常适合web2.0开发使用 如果配合jquery效果更好 且能保存数据至数据库、cookie、xml等

拖动DIV如何保存的问题

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head&...

anjichan4261的博客 171

JS拖拽DIV后保存位置示例

本实例从通达OA工作桌面提取,包括js、css,浏览空白时,请将浏览器编码改为UTF-8

使用cookie记忆拖拽的div的位置:js实现

前言:实现鼠标拖拽移动div位置,当一次移动完成,鼠标键抬时,此时的位置属性值存入cookie。刷新页面,从新从cookie中取出div的位置属性值,从而实现对div位置的记忆。 1.页面代码: <head> <meta charset="UTF-8"> <title></title> <style> .box { position: absolute; w

kilig 554

CentOS7全隔离环境部署Nvidia Tesla A100 40G驱动与CUDA工具包实战

本文详细介绍了在CentOS7全隔离环境下部署Nvidia Tesla A100 40G显卡驱动与CUDA工具包的实战经验。通过构建本地YUM仓库、解决驱动依赖问题以及三重验证法,确保Tesla A100与CUDA 11.7的完美兼容。同时分享了Anaconda3离线部署技巧,帮助用户在隔离环境中高效搭建Python GPU开发环境。

weixin_27215337的博客 405

银河麒麟v10-arm SEALOS离线部署k8s集群(v1.22.8)

示例 如果你想保存一个名为 "my_snapshot" 的 etcd 快照到指定的对象路径你可以使用以下命令: sealos etcd save --backupPath /root --name my_snapshot 如果文件名带时间戳:my_snapshot$(date +"%Y%m%d_%H%M%S") 会生成一个形如 20230913_143045 的时间戳。--restorePath string:指定快照恢复目录(默认为 "/opt/sealos/etcd-restore")。

xjudt的博客 3292

js 拖拽效果(cookie)

一个带有cookies的拖拽效果,代码尚未封装。

江湖再见 1288

ISO26262 功能安全各个阶段测试要求

1. 开发过程说明 系统层面:包括软硬件集成测试、系统集成测试以及整车测试。 硬件层面:包括硬件集成与测试。 软件层面:单元测试、集成测试。 2. 功能安全总体要求 2.1 各项指标 2.2 诊断覆盖度举例 针对一个信号举例说明: 3. 功能安全测试要求 3.1 测试计划 核心内容应包括, 测试对象:需要测试的对象描述,以及测试的范围描...

AgingMoon的博客 1万+

JS容器拖拽效果,并通过cookie保存拖拽各容器的所在位置

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> &l...

djbjh55539的博客 241

python因子数_Python与量化多因子——因子库(下)

1. 前言有点泄气,读者不多,赞同也不多,不过万事开头难。上一篇我分享了因子库的设计,这一篇主要讲实现,加上我的标题叫Python与量化多因子,势必要加点代码在里头,不过旨在抛砖引玉,点到即止,更多的内容需要读者们自己去探索。对了,读者如果自己动手,基础的Pandas,Numpy的操作还是需要会的,网上也有很多教程,大家也可以去看,如果有需要,后面我也可以写篇文章来介绍。2. 因子构成好像现在各家...

weixin_39523625的博客 1225

开源CC6920差分霍尔电流传感器模块实战指南——从选型到波形分析

本文详细介绍了CC6920差分霍尔电流传感器模块的选型、硬件连接、参数计算及波形分析技巧。通过实战案例,展示了该开源硬件在电流测量中的优势,包括超低内阻、电气隔离和抗干扰能力,适用于电机控制、开关电源保护等场景。

weixin_28738397的博客 379

js拖拽元素并保存刷新

h5 新特性 draggable,可实现简单拖拽。拖拽完成后,本机存储dom字符串的cookie,下次打开实现数据刷新。 <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" c.

wgod 694

VXWorks6.9 + Workbench3.3 开发环境部署

VxWorks6.9 + Workbench3.3的安装部署,以及简单示例项目的创建、编译和运行

Mr.Sugarcane 5516

jquery 实现页面拖拽并保存到cookie

实现的效果就是页面内的图片可拖拽到任意位置,并将所在位置保存.下次打开页面依然可见.本文是作demo用,实际开发中,位置的数据应保存到数据库中. 好了,开始. 1.准备工作. a.jquery(1.7.2),ui,cookie插件,json插件.一些图片(本文是5张). 2.页面. 上代码 1 2 3 4 5 6 7 <divc...

weixin_30338461的博客 106

Yield Management软件:Lam Research二次开发_(5).缺陷分析与分类方法

在半导体制造过程中,缺陷分析和分类是提高良率管理(Yield Management)的关键步骤。通过准确地识别和分类缺陷,可以更好地理解工艺过程中的问题,从而采取有效的措施来提高生产效率和产品质量。本节将详细介绍缺陷分析和分类的方法,包括缺陷检测、特征提取、分类算法及其在Lam Research软件中的应用。

2401_87715305的博客 695

ARM功耗管理软件之DVFS&AVS

思考:功耗管理软件栈及示例?WFI&WFE?时钟&电源树?DVFS&AVS?

AI-安全-功耗 1236

【转】JS容器拖拽效果,并通过cookie保存拖拽各容器的所在位置

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" > ...

weixin_30757793的博客 184

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

类似Chinaren首页栏目可拖动效果的源码

类似Chinaren首页栏目可拖动效果的源码注:本文摘编自网络(经典论坛) ,文责版权为原作者所有,本人仅作学习收藏。代码原理为拖动DIV并保存,未使用server技术。源代码如下:Drag & Dropbody{ background-color:#36393D; font-size:12px; margin:0px; }DIV.dragLayer{

小李专栏 2164

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Jquery拖拽并简单保存的实现代码

今闲着无聊 顺便看了下jquery ui的拖拽插件,实现拖拽的方法很简单,看到效果后兴奋小下... 但是如何保存顺序呢,想到了cookie,但是用如何用cookie保存顺序呢,直接保存html代码下次读取覆盖可以,但是总感觉内容多的话 保存的东西比较多,后用ui插件获取id保存id在读取实现了顺序的保存,废话不多说..直接看代码... 复制代码 代码如下:

smshuxue的专栏 817

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

jQuery配合cookie实现拖拽运动记忆小方块

jQuery配合cookie实现拖拽运动记忆小方块 简单实现物体拖拽运动并在关闭浏览器后 下次打开浏览器,物体保留在原来的位置 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>记忆小方块</title> <style type="te...

weixin_44414835的博客 246

Jquery拖拽并简单保存

今闲着无聊 顺便看了下jquery ui的拖拽插件,实现拖拽的方法很简单,看到效果后兴奋小下...但是如何保存顺序呢,想到了cookie,但是用如何用cookie保存顺序呢,直接保存html代码下次读取覆盖可以,但是总感觉内容多的话 保存的东西比较多,后用ui插件获取id保存id在读取实现了顺序的保存,废话不多说..直接看代码... <!DOCTYPE html PUBLIC "-//W3...

weixin_30709061的博客 147

div 上移下移技术

 作者地址:http://www.52hai.com/2005/article.asp?id=1861要移到中间,就有上移与下移 .a7container {FLOAT: left; WIDTH: 385px; POSITION: relative}.a2 {FLOAT: left; WIDTH: 385px; POSITION: relative;}#rc4 {BACKGRO

zhdd1234的专栏 2846

ajax拖拽布局

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">拖拽+COOKIE保存*{font-size:12px}/*样式class*/.dragTable{font-size:12px;border-top:1px solid #3366cc;margin-bottom: 10px

asp、.net专栏 927

原生js配合cookie制作保存路径的拖拽

用cookie实现拖拽

weixin_56529964的博客 253
上一篇: HTML DOM的nodeType值
下一篇: k-means聚类算法的【java描述】
Java2King
博客等级 码龄18年 221粉丝 77原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值