超链接的各种功能

超链接的各种功能:

     <!DOCTYPE html>  
    <html>  
    <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <title>超链接的各种功能</title>  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">  
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>  
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>  
    </head>  
    <body>  
    <div data-role="page">  
      <div data-role="header" data-position="fixed">  
        <h1>超链接的各种功能</h1>  
      </div>        
      <div data-role="content">  
        <p><a href="sms:10086?body=短信内容" data-role="button" data-theme="a">测试发短信(移动端)</a></p>  
        <p><a href="tel:10086" data-role="button" data-theme="a">测试打电话(移动端)</a></p>  
        <p><a href="mailto:test@163.com" data-role="button" data-theme="a">测试发邮件</a></p>  
        <p><a href="weixin://" data-role="button" data-theme="a">打开微信(移动端)</a></p><!-- 使用RUL scheme 打开app -->
        <p><a href="weixin://dl/moments" data-role="button" data-theme="a">打开微信朋友圈(移动端)</a></p><!-- 使用RUL scheme 打开app -->
        <p><a href="test.txt" data-role="button" data-theme="a">读取文件</a></p> 
        <p><a href="javascript:void(0);" data-role="button" data-theme="a">调用js</a></p> 
        <p><a href="javascript:alert('这是弹窗内容')" target="_blank" data-role="button" data-theme="a">弹窗</a></p> 
        <p><a href="#test" data-role="button" data-theme="a">锚点链接</a></p> 
        <p><a href="http://www.baidu.com" data-role="button" data-theme="a">跳转到一个网页</a></p> 
        <p><a href="#" data-role="button" data-theme="a">空链接</a></p> 
      </div>  
      <div data-role="footer" data-position="fixed">  
        <h1>超链接的各种功能</h1>  
      </div>  
    </div>  
    </body>  
    </html>  

超链接跳转到不同页面的锚点链接:

在做前端的时候,有时会遇到这样一种情况:要在此页面跳转到另一个页面的某个地方。这种情况,就可以使用超链接和锚点链接进行调转了。比如要从index.html页面的某个超链接调转到single.html页面的底部,则此时可在single.html页面底部添加一个锚点。然后在index.html的超链接里加上此锚点的名称即可。

index.html页面的超链接:

<a href="single.html#CompanyProfile">企业概况</a>

single.html页面的锚点:

<h2><a name="CompanyProfile">企业概况</a></h2>

这样,在index.html页面点击了超链接后就直接跳转到single.html页面“企业概况”标题了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值