私は2つの異なるファイルのシナリオを持ち、別のファイルを1つのHTMLにロードする必要があります。別のファイルのhtmlにjsアクションをロードする方法
Iframe.htmlの:
<select data-placeholder="Choose a Country..." class="flexselect">
<option value=""></option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Algeria">Algeria</option>
<option value="Bermuda">Bermuda</option>
<option value="Bhutan">Bhutan</option>
</select>
<iframe src="index.html" style="width:100%; border: 0px solid #fff;"></iframe>
のindex.html:それはあまりにも働いていないのと同時に、すべてのエラーを表示しません
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://rmm5t.github.io/jquery-flexselect/flexselect.css">
</head>
<body>
<script src="http://code.jquery.com/jquery-1.6.4.js" type="text/javascript"></script>
<script src="http://rmm5t.github.io/jquery-flexselect/jquery.flexselect.js" type="text/javascript"></script>
<script src="http://rmm5t.github.io/jquery-flexselect/liquidmetal.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("select.flexselect").flexselect();
});
</script>
</body>
</html>
。私が観察したことは、iframeタグの上にあるselectタグでトリガされないことです。
index.html
ページで選択タグのコンテンツを保持していてもiframeが完全なドロップダウンコンテンツを表示することはできません。それはスクロールすることを可能にする特定の高さ&に制限されています。
iframeにselectタグを残すことができないため、iframeから外す必要があります。
どうすればそれを有効にすることができますか?
index.htmlで選択してもiframeになるのは混乱しますか? – snit80
@ snit80、はい..私の場合はフレームが必要です。状況は、別のファイルにindex.htmlファイルをロードする必要があるため、iframeを使用しているようです。しかし、私はiframeで選択タグを保持するときこれは問題です(http://stackoverflow.com/questions/39741412/jquery-chosen-content-not-getting-out-of-the-iframe-instead-scrolled-within- ) – kumar
あなたはiframeに高さを与えると考えましたか? – snit80