2024-11-08 00:51:17
单纯的实现效果有很多种方法。
直接跳转页面也行,下拉菜单包着a标签
下面用iframe,也行,点击的时候用js替换src
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<style type="text/css">
.select{width:80px;}
</style>
<body>
<select id="select">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<div class="page_title" style="height:800px;border:1px solid #000;">
<iframe class='myIframe' src="html/redenvelope.html" scrolling="yes" frameborder="0" width="100%" height="100%" id="main_iframe"></iframe>
</div>
<script type="text/javascript">
$('option').on('click',function(){
$('.myIframe').attr('src','跳转的页面.html?title="+encodeURI($(this).text()));
});//添加点击事件替换src
</script>
</body>
</html>
2024-11-08 01:58:25
2024-11-08 03:04:43
能把代码给写一下吗 谢了