Javascript 如何将现有菜单更改为响应性设计?
我使用php、html和css创建网站。其不存在的响应站点。我想更改现有菜单以响应我的站点? 我的菜单全局导航和管理界面是否显示无响应?我的代码是它设计的表?我将如何更改任何方法 这里我的代码粘贴在这里:Javascript 如何将现有菜单更改为响应性设计?,javascript,php,jquery,html,css,Javascript,Php,Jquery,Html,Css,我使用php、html和css创建网站。其不存在的响应站点。我想更改现有菜单以响应我的站点? 我的菜单全局导航和管理界面是否显示无响应?我的代码是它设计的表?我将如何更改任何方法 这里我的代码粘贴在这里: <?php $session_file=$dir_sessions.".".$sid; if(file_exists($session_file)&&$sid!="") { //echo "if"; $sfile=file($ses
<?php
$session_file=$dir_sessions.".".$sid;
if(file_exists($session_file)&&$sid!="")
{
//echo "if";
$sfile=file($session_file);
$sinfo=explode("||",$sfile[0]);
#################################################
$lms_userID=$sinfo[0];
$lms_exptime=$sinfo[1];
$lms_username=$sinfo[2];
$lms_useremail=$sinfo[3];
$lms_userlevel=$sinfo[4];
$lms_user_group=$sinfo[5];
$lms_user_subgroup=$sinfo[6];
$lms_usergroup_file=$sinfo[7];
$lms_org=$sinfo[8];
}
?>
<script type="text/javascript">
function changePassword()
{
window.open('changepassword.php','ChangePassword','resizable=0,width=650,height=550,scrollbars=0');
}
</script>
<div id="menu">
<br />
<table width="186" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="186"> </td>
</tr>
<tr>
<td width="186" ><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><B> Global Navigation</B></font></td>
</tr>
<?php
if($lms_userlevel!=1){
?>
<!-- <tr >
<td width="186" background="images/menubg.gif"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><img src="images/bullet.gif" align="absmiddle"> <A HREF="index.php?section=register&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;">New Users</A></font></td>
</tr>
<tr >
<td width="186" background="images/menubg.gif"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><img src="images/bullet.gif" align="absmiddle"> <A HREF="index.php?section=login&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;">Log In</A></font></td>
</tr>-->
<?php
}
?>
<tr >
<td width="186" ><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=landing&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Main</A> </font></td>
</tr>
<tr >
<td width="186"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=enrollment&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Your Enrollment</A> </font></td>
</tr>
<tr >
<td width="186" ><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=courselist&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Courses </A> </font></td>
</tr>
<?php $status="no"; if($lms_userlevel>=2){ $status="yes"?>
<tr >
<td width="186" ><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=reports&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Reports</A> </font></td>
</tr>
<?php }?>
<tr >
<td width="186"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=news&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> News</A> </font></td>
</tr>
<tr >
<td width="186"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=messageboard&sid=<?php echo $sid; ?>" ; STYLE="text-decoration:none;COLOR:#3E3E3E;"> Message Board</A> </font></td>
</tr>
<tr >
<td width="186" ><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=library&sid=<?php echo $sid; ?>"; STYLE="text-decoration:none;COLOR:#3E3E3E;"> Repository</A> </font></td>
</tr>
<!--
<tr >
<td width="186" background="images/menubg.gif"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><img src="images/bullet.gif" align="absmiddle"> <A HREF="index.php?section=forums&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;">User Forums</A> </font></td>
</tr>
<tr >
<td width="186" background="images/menubg.gif"><img src="images/bullet.gif" align="absmiddle"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=search&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;">Search</A> </font></td>
</tr>
<tr >
<td width="186" background="images/menubg.gif"><img src="images/bullet.gif" align="absmiddle"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="index.php?section=news&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;">What's New</A> </font></td>
</tr>
-->
</table>
<?php
//echo "level = ".$lms_userlevel;
if($lms_userlevel>=3){
?>
<table width="186" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="186"> </td>
</tr>
<tr >
<td width="186"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><A HREF="#" onClick="window.open('admin/admin.php?sid=<?php echo $sid; ?>','ADMIN','fullscreen,scrollbars=yes')"; STYLE="text-decoration:none;COLOR:#3E3E3E;"><strong> Admin Interface</strong></A> </font></td>
</tr>
<tr>
<td width="186"> </td>
</tr>
</table>
<?php }?>
<table width="186" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="auto"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><strong> Public Documents</strong></font></td>
</tr>
<tr>
<td width="auto"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><a href="index.php?section=faqs&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> FAQs</a></font></td>
</tr>
<tr>
<td width="auto"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><a href="index.php?section=newsletter&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Newsletters</a></font></td>
</tr>
<tr>
<td width="auto"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><a href="index.php?section=additional_resources&sid=<?php echo $sid; ?>" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Additional Resources</a></font></td>
</tr>
</table>
<table width="186" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="auto"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#3E3E3E"><a href="javascript:changePassword();" STYLE="text-decoration:none;COLOR:#3E3E3E;"> Change Password</a></font></td>
</tr>
<tr>
<td width="auto" rowspan="3"> </td>
<td width="auto" rowspan="3"> </td>
<td width="auto" rowspan="3"> </td>
</tr>
</table>
</div>
函数changePassword()
{
open('changepassword.php','changepassword','resizeable=0,width=650,height=550,scrollbars=0');
}
全球导航
公共文件
有什么办法可以帮我吗 我也在学习过程中。如果我是你,我会怎么做。我将首先基于您已经迁移的元素创建一个响应性布局,然后相应地迁移php代码 1) 规划您希望布局的响应速度。只是为了适应不同的电脑屏幕尺寸,比如全宽可调尺寸?或者在分辨率更改时使用不同的布局 2) 使用不同的div(s)、ul(s)、li(s)而不是一个表,这样您可以更轻松地管理和移动元素 3) 使用百分比而不是固定的像素宽度 当然,到那时,你会遇到很多定位、间距、边距、填充的问题,但至少你开始了 有很多框架告诉你,你可以在15分钟内建立一个负责任的网站。相信我,这是谎言。这是为那些知道自己在做什么的更有经验的开发人员准备的 即时解决方案:使用以下内容创建css文件:
table, tr, th, td {
box-sizing: border-box;
}
table.content {
border-collapse: collapse;
width: 100%;
}
th {
font-weight: bold;
background-color: black;
}
td.course_title {
background-color: white;
width: 30%;
}
td.launch_link {
width: 30%;
}
// assign class to your table and tds
上面缺少了很多元素。只是给你一个想法。希望这能帮助你开始
祝你好运。首先,当你想创建一个响应性强的网站时,你从不使用表格。你也可以使用媒体查询,但如果你想尝试使用表格,你的头就会卡在这个网站上。只是说说而已。为了你将来的知识和美好。你可以看到和理解更多,但在谷歌上有更多的例子。如果可能的话,让表格具有响应性是一件痛苦的事情。您的HTML标记似乎是10年前编写的,在我看来,您需要学习更多关于编写好的标记和布局的知识,然后才能这样做。一个好的开始是学习引导框架,并从那里开始。这不是我的项目,先生,我只有处理纠正现在我的工作改变到响应网站