Cutesoftエディタやカラーボックスを混合Javascriptの問題
-
20-09-2019 - |
質問
私は若干のjavascriptの問題があり、これは私がJavaScriptを嫌う理由理由です。 私のページでは、私は新しいイメージを追加する可能性のdivをポップアップするためにカラーボックスを使用します。それから私は、ユーザーが画像を選択することができるウィンドウを開き、画像ピッカーとしてCutesoftエディタを使用しています。私の問題は、彼らがポップアップを閉じない限り、ユーザーが画像を選択することはできませんので、画像ピッカーウィンドウは、カラーボックスの後ろに開くことです。 画像ピッカーのためのカラーボックスとボタンの画像http://gazet.se/TemporaryFiles/preview.png の 私は私が見つけることができますCutesoftのためのすべてのドキュメントを読んでいると私は見つけることができる唯一のコマンドはeditor.FocusDocument(ある)それはまだ仕事をdoes't。私はカラーボックスは、この問題の原因とCutesoftがカラーボックスの上にポップアップを表示することが許可されていないことをされていることを疑い始めています。
コード画像のポップアップを表示する(画像上のボタンが押されたときに実行):
function callInsertImage(clientID) {
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
editor1.FocusDocument();
var editdoc = editor1.GetDocument();
editor1.ExecCommand('new');
editor1.ExecCommand('InsertImage');
editor1.FocusDocument();
InputURL(clientID);
editor1.FocusDocument();
}
function InputURL(clientID)
{
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
var editdoc = editor1.GetDocument();
var imgs = editdoc.images;
if(imgs.length > 0) {
document.getElementById(clientID).value = imgs[imgs.length - 1].src;
if (document.getElementById(clientID).value.substr(0, 19) == 'http://www.gazet.se')
document.getElementById(clientID).value = "~" + document.getElementById(clientID).value.substr(19);
editor1.ExecCommand('new');
document.getElementById(clientID).focus();
}
else {
setTimeout(function() { InputURL(clientID); }, 500);
}
}
カラーボックスを開くために、コードます:
function NewImage() {
ResetBox();
this.boxTitle.innerHTML = 'Ny bild';
this.buttonSave.value = 'Lägg till bilden';
$.fn.colorbox({open:true,width:"700px",inline:true,href:"#inline_example1",speed:100});
}
解決
私はそれが積層順を担当しているこれらの層(HTML要素)、のCSSプロパティに関係していると思います。 (Firebugの。すなわち)それを調べてz-index
を検索します。ウィンドウピッカーのzインデックスはCutesoftエディタのzインデックスよりもおそらく低います。
の編集の私はちょうどそれをチェックします。カラーボックスはz-index:9999;
を持っており、ImagePickerはz-index: 8888;
を持っています。私はcolorbox.css
ライン6を変更することをお勧めします。
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:8000; overflow:hidden;}