Embedly/jquery-Preview已經太棒了。但是,我試圖改變預覽結果的位置,並遇到麻煩。現在,結果出現在輸入字段下方......但我寧願將它放在頁面的單獨部分。有沒有辦法做到這一點?Embedly(JQuery-Preview)結果的位置
我試着改變選擇器的位置和加載div,但是這並沒有幫助。它似乎忽略這些div,並將其放在提交按鈕的正下方。
下面是我的代碼:
<form accept-charset="UTF-8" action="private" class="new_comment" data-remote="true" id="new_comment" method="post">
<input class="photo_comm" id="comment_comment" name="comment[comment]" placeholder="add a comment or link..." size="30" type="text" /><span type="text" id="counter">1000</span>
<input class="btn btn-primary btn-mini" data-disable-with="Submitting..." name="commit" type="submit" value="Post" />
</form>
<!-- Placeholder that tells Preview where to put the loading icon-->
<div class="loading">
<img src='http://embedly.github.com/jquery-preview/images/loading-rectangle.gif'>
</div>
<!-- Placeholder that tells Preview where to put the selector-->
<div class="selector"></div>
$('#comment_comment').preview({ key:'60f1dcdf3258476794784148a6eb65e7', // Sign up for a key: http://embed.ly/pricing
selector : {type:'rich'},
preview : {
submit : function(e, data){
e.preventDefault();
$.ajax({
dataType: 'script',
url: this.form.attr('action'),
type: 'POST',
data: data
});
},
},
autoplay : 0,
maxwidth : 400,
display : {display : 'rich'}
});
UPDATE
我可以移動選擇()並在窗體中了下來...但不能將它移動到表單之外,或者放在表單之間選民div和表格的結尾。我需要將選擇器移到表單外部,這是問題所在。任何幫助都會很棒。謝謝。
謝謝,由於某種原因,仍然不能得到這個工作。它仍顯示在#comment_comment字段下方。 – user749798
你有什麼地方可以檢查嗎? –
想通了......必須直接編輯jquery.preview.js,因爲現在它只在表單字段(不在其外部)中搜索選擇器。 – user749798