3
我有一個鏈接和並排放置的按鈕。當用戶點擊按鈕時,鏈接的文本應該可以編輯。jquery editInPlace錨文本編輯
我爲使用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的克隆https://github.com/VihaanVerma89/dummy.git
當您說「鏈接文本變爲可編輯但我不能在文本編輯後恢復鏈接屬性。」你有什麼具體問題?鏈接目標是否丟失/未設置? – Yablargo