javascript-jQuery editInPlace锚文本编辑
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javascript-jQuery editInPlace锚文本编辑,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3232字,纯文字阅读大概需要5分钟。
内容图文
我有一个链接和一个按钮并排放置.当用户单击按钮时,链接的文本应变为可编辑的.
我正在使用jquery editInPlace来使链接的文本可编辑.链接的文本变为可编辑状态,但在文本编辑后无法恢复链接属性.
这是我的html和javasrcript文件
demo.js
1 $(document).ready(function(){
2 $("img.modifyButton").click(function(){
3 $(this).prev().editInPlace({
4 success: function(){
5 $(this).unbind('.editInPlace');
6 $(this).unbind('click');
7 },
8 url:'Admin/p.inline_coupon_edit_frontend.php',
9 text_size:55,
10 show_buttons: false,
11 params:"field=Title"
12 });
13
14 $(this).prev().on('click', function(event)
15 {
16 event.preventDefault();
17 });
18 $(this).prev().click();
19 });
20
21 });
html文件
16 <div class="crux">
17 <a href="www.google.com">title</a>
18 <img class="modifyButton" src="./editInPlace_files/modifyButton.png" alt="None" width="13" height="13">
19 </div>
git回购代码:git clone https://github.com/VihaanVerma89/dummy.git
解决方法:
不太确定您的问题是什么.您的php文件为空,但是当使用回调而不是PHP文件时,一切似乎都可以正常工作-链接目标是完整的.
您的版本出了什么问题?您是从php文件返回值吗?如果不是这样,我相信
除非我想念您想要做的事情,否则这似乎很好用:
$(document).ready(function(){
$("img.modifyButton").click(function(){
$(this).prev().editInPlace({
success: function(){
$(this).unbind('.editInPlace');
$(this).unbind('click');
// alert('success');
},
error: function(){
$(this).unbind('.editInPlace');
$(this).unbind('click');
//alert('error');
},
callback: function(b,abc){
return abc;
},
text_size:55,
show_buttons: false
,params:"field=Title"
});
$(this).prev().on('click', function(event)
{
event.preventDefault();
});
$(this).prev().click();
});
});
我认为问题出在您的php脚本中-上面的示例作为示例,其中不包含php-因为它未包含在您的git repo中.
内容总结
以上是互联网集市为您收集整理的javascript-jQuery editInPlace锚文本编辑全部内容,希望文章能够帮你解决javascript-jQuery editInPlace锚文本编辑所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。