douyong2531 2010-12-09 07:53
浏览 50
已采纳

如何将登录界面与页眉页脚分开,如果没有它

I want to know how to get different login interface for my web without change to the URL name. Example

<ul>
  <li><a href="http://domain.com/login/">Login</a></li>
</ul>

If user click on the Login I want to make it display on Ajax popup. Just show the login & password form. I'm using ColorBox. Example Outside HTML (Ajax)

If user type http://domain.com/login/ that page will include header, footer and etc.

Let me know what to put in my login.php to make it to be different.

  • 写回答

4条回答 默认 最新

  • douran6443 2010-12-09 08:21
    关注

    You don't need to put any changes to your http://domain.com/login (potentially). You just have to attach the colorBox plugin to the link. It handles the popup and the e.preventDefault() call so people won't get the popup and the page. It's usually best to give the links an Id or class (like I have below).

    <ul>
      <li><a class="loginlink" href="http://domain.com/login/">Login</a></li>
    </ul>
    
    $('a#loginlink').colorbox({href:"/yourLogin.html"});
    

    Since you're using the Outside HTML example, you can do the above (replacing the filename with your actual HTML).

    However, since it's not an incredibly huge piece of code to display a login form, you can include it in your page (but hidden) and pass this to the ColorBox plugin using the Inline Html example:

    $('.loginlink').colorbox({
        inline: true,
        width: "50%",
        href: "#loginBox"
    });
    

    An example of the inline HTML working: http://jsfiddle.net/jonathon/MHhNX/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程