zoukankan      html  css  js  c++  java
  • smart code

    一行代码将网页分享到QQ、微博等

    <ul id="content-share-list"  class="bdsharebuttonbox bdshare-button-style0-16">
      <li><a class="content_qq" onclick="window.open('http://connect.qq.com/widget/shareqq/index.html?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ">QQ好友</a></li>
      <li><a class="content_qqzone" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;">QQ空间</a></li>
      <li><a class="content_weixin" data-cmd="weixin">微信好友</a></li>
      <li><a class="content_sina" href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title.substring(0,76))+'&url='+encodeURIComponent(location.href)+'&rcontent=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">新浪微博</a></li>
    </ul>
    <!-- 点击微信好友生成的二维码 -->
    <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
    

      

    一行代码滚动显示本地天气

    <iframe name="weather_inc" src="http://i.tianqi.com/index.php?c=code&id=11" width="500" height="15" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" ></iframe>
    

      

    input框中只能输入非负整数

    <input type="text" value="3" maxlength="3" style="width : 30px;text-align: right;" onKeyUp="value=(parseInt((value=value.replace(/D/g,''))==''?'0':value,10))" />
    
  • 相关阅读:
    ||和&&
    用jQuery编的一个分页小代码
    Intent携带额外的数据的方法
    Handler消息传递机制
    安卓中的消息提示
    使用AlertDialog创建对话框的大致步骤
    布局管理器
    Android中支持的常用距离单位
    开发自定义View
    Gridview中奇偶数行颜色设置
  • 原文地址:https://www.cnblogs.com/shiysin/p/10551317.html
Copyright © 2011-2022 走看看