关于三星手机浏览器marquee宽度的问题

本文介绍了一种使用HTML和JavaScript实现的响应式网页布局方案,通过具体的代码示例展示了如何利用HTML表格元素配合内联样式及JavaScript进行交互式设计。文章重点在于演示如何创建动态标题栏,并实现跑马灯效果。

参考:

http://www.360doc.com/content/14/1210/17/9060464_431831883.shtml

例子:

<table width="100%" border="0px" cellpadding="0" cellspacing="0" style="font-family:微软雅黑;font-size:21px;line-height:30px;color:#FF7A32;">
<tr>
<td height="40px" onclick="BackHome();return false;" width="30px" align="left" valign="middle" style="cursor:pointer;">
<a href="#"  ><img src="public/images/computer/mobile/fanhui.png" style="height:20px;"/></a>
</td>
<td align="left">
<span style="color:#000000;display:block;overflow:hidden;height:30px;" onclick="Addmarquee_cont($(this));return false;">{$un_title}</span>
</td>
<td width="5px">
&nbsp;
</td>
<td align="center" valign="middle" width="65px" >
<span id="" style="font-size:25px;color:green;">0</span>/<span id="" style="color:#000000;">0</span>
</td>
<td align="right" valign="middle" style="display:none;">
<table cellspacing="0" cellspacing="0" align="right">
<tr>
<td height="50px" valign="middle" style="padding-right:5px;">
<img src="public/images/computer/mobile/time.png" style="height:25px;width:25px;"/>
</td>
<td valign="middle">
<span id="" style="font-size:20px;line-height:30px;">0:0:0</span>
&nbsp;
</td>
</tr>
</table>
</td>
<!--{if !$in_tuiguang_tiyan}-->
<td align="center" valign="middle" width="70px" id="lewendy_button_outer">
<a href="#" onclick="MbFrame.AskTeacher();return false;" style="width:70px !important;border:1px solid red;"><span id="" style="color:#FF7A32;font-family: 微软雅黑;">答疑</span></a>&nbsp;
</td>
<!--{/if}-->
<td align="right" valign="middle" width="35px" id="menu_button_outer">
<a href="#" onclick="ShowHideToolBar(); return false;"><img src="public/images/computer/mobile/caidan.png" style="width:25px;"/></a>
</td>
</tr>
</table>


js

// 做题单元跑马灯 点击停止与运行 obj marquee跑马灯对象 id 
    TopBarTitleMarquee:  function (obj, id){
        var flog =  $('#'+id).attr('data');
        if(flog == 0){ // 停止
            obj.stop();
            flog = 1;
        }else{ // 开始
            obj.start();
            flog = 0;
        }
        $('#'+id).attr('data',flog);
    },


    // 添加跑马灯
    Addmarquee_cont : function(obj){
        if(Marquee) return false;
        var cont = obj.html();
        var width = obj.width();
        var html = '<marquee width='+width+' onclick="TopBarTitleMarquee(this,\'top_bar_title_marquee\');return false;" id="top_bar_title_marquee" behavior="scroll" data="0">';
        var html2 = '</marquee>';
        obj.html(html+cont+html2);
        Marquee = true;
    },

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值