• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

怎么把select下拉菜单里的文字设置成左右滚动效果

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
希望用marquee标签来设置字体滚动,代码是下面这样写的,但是没有效果,字体还是不会滚动,应该怎么来写,才会实现这个效果呢?
<html:select property=”w_project_cd[]” value=”<%=prj.toString()%>” onchange=”<%=js.toString()%>” style=”width:260px”>
<logic:notEmpty name=”proj_list”>
<marquee direction=”left” behavior=”scroll” scrollamount=”10″ scrolldelay=”200″> <html:options collection=”proj_list” property=”value” labelProperty=”label”/></marquee>
</logic:notEmpty>
</html:select>
在网上找到了一个类似的例子,如下详细的代码:
HTML code:

复制代码
代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function init(){
var os=document.getElementsByTagName("option");
for(var i=0;i<os.length;i++){
var tx=os[i].innerHTML;
var l=tx.length;
var b=tx.substring(0,1);
var e=tx.substring(1);
os[i].innerHTML=e+b;
}
window.setTimeout(init,1000);
}
window.onload=init;
</script>
</head>
<body>
<select>
<option>一个用法</option>
<option>也许人生就是如此</option>
<option>云在青天,水在瓶</option>
</select>
</body>
</html>

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
如何把select下拉框的值传到id中实现代码发布时间:2022-06-21
下一篇:
gbk utf8如何选择 正确理解和使用GBK及UTF-8网页编码发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap