我有一个显示值的 javascript onchange 列表框,但我插入的灯箱代码不显示。我想将值列表框添加到链接,因为我想编辑页面是灯箱。
示例-><a class="various" data-fancybox-type="iframe" href="edit.php?id=<?**listbox value is onchange**?>">Edit</a>
如何将返回值列表框用于变量?
此代码 onchange 列表框
<label for="country">Country</label>
<select name="country" id="country">
<option value="1">Thailand</option>
<option value="2">England</option>
<option value="3">Japan</option>
</select>
<div id="selected_value"></div>
<label for="country">Country:</label>
<input type="text" name="country" id="country" class="country">
<script type="text/javascript">
$('#country').on("change", function(){
//Get the selected value
var selected_value = $("#country option:selected").val();
//Write the selected value to our div
('#selected_value').html(selected_value);
});
</script>
灯箱代码
<script type="text/javascript" src="../wp-content/plugins/pop-up/include/js/scripts/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="../wp-content/plugins/pop-up/include/js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="../wp-content/plugins/pop-up/include/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="../wp-content/plugins/pop-up/include/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript">
$(document).ready(function($) {
$(".various").fancybox({
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '80%',
height : '80%',
autoSize : false,
closeClick : false,
hideOnOverlayClick : false,
openEffect : 'none',
closeEffect : 'none',
type : 'iframe',
onClosed : function() {
parent.location.reload(true);
}
});
});
</script>