Jquery控制滚动显示欢迎字幕v2:

之前做的那个比较适合测试环境,但要套入到网站中,有两个按钮在那摆着,还是不太好看。后面对代码进行了修改,如下:

参考代码:

<html>
<head>
<title>Colin-Welcome</title>
<meta name="description" content="Colin-Welcome" />
<meta charset="utf-8" />
<script type="text/javascript" src="jquery.js"></script> <style type="text/css">
html, body {margin: 0;padding: 0;height: 100%;overflow-y: hidden;overflow-x: auto;}
#mainFrame { min-width:1000px; }
.marquee_hint input{padding: 3px 8px;}
#welcome{position:absolute;bottom:30px;width: 100%;height: 100px;}
#welcome_text{opacity: 0.7;color:#fff;line-height: 100px;font-size:70px;}
#int_text{position:absolute;width:350px;left:100px;top:0px;background: #F3F7FA;opacity:0.9;padding:3px;}
#hotclick {width: 100px;height: 100px;position: absolute;left: 0;right:0;border: 1px solid #ccc;display: block;cursor:pointer;}
</style> <script type="text/javascript">
/*Colin最后更新于2015-09-18*/
$(document).ready(function(){
/*未加载成功时不显示*/
$("#int_text").hide();
$("#welcome").hide(); $("#hotclick").click(function () {
if($("#welcome").css("display")=="none"){$("#welcome").show();}
else{$("#welcome").hide();}
}); $("#hotclick").dblclick(function () {
//双击事件的执行代码
if($("#int_text").css("display")=="none"){$("#int_text").show();}
else{$("#int_text").hide();}
});
/*提交设置内容后判断并显示*/
$("#int_text").find("input").click(function(){
int_text=$("#int_text").find("textarea").val();
if(int_text==""){
alert("显示内容不能为空!")
}
else{
$("#int_text").hide();
$("div").find("marquee").text(int_text);
$("#welcome").show();
}
});
});
</script>
</head>
<body> <!--控制区-->
<div id="hotclick" ></div> <!--设定框-->
<div id="int_text">
<p>输入你要显示的文字内容,然后点击确定!</p>
<textarea style="width:98%;height:100px;font-size:16px;margin-bottom: 5px;"></textarea>
<input type="button" value="提交并显示" style="float: right;">
</div> <!--滚动字幕-->
<div id="welcome">
<marquee bgcolor="red" scrollamount="20" id="welcome_text">欢迎参观XXXXX公司</marquee>
</div> <iframe src="http://www.baidu.com" height="100%" width="100%" id="mainFrame" frameborder="no">
</iframe>
</body>
</html>

  

参考图:

Jquery控制滚动显示欢迎字幕v2的更多相关文章

  1. Jquery实现滚动显示欢迎字幕效果

    Jquery控制滚动显示欢迎字幕: 参考代码: <!DOCTYPE html> <html> <head> <title>Colin Marquee W ...

  2. jquery 上下滚动显示隐藏

      function scroll(fn) { var beforeScrollTop = document.body.scrollTop, fn = fn || function() {}; win ...

  3. jQuery控制元素显示、隐藏、切换、滑动的方法

    jQuery 隐藏和显示 通过 hide() 和 show() 两个函数,jQuery 支持对 HTML 元素的隐藏和显示: 实例 $("#hide").click(functio ...

  4. jquery页面滚动显示浮动菜单栏锚点定位效果

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  5. JQuery 控制元素显示隐藏

    JS在浏览器里面做调试的时候,先在浏览器里面找到页面代码加上断点来执行.然后根据执行情况来查找部分变量是否能找到,一点一点的排查内容.可以做筛选条件 部分隐藏.默认让部分条件加上.hide 默认隐藏, ...

  6. jQuery控制TR显示隐藏

    参考链接:http://www.jb51.net/article/51221.htm 通过jQuery的hide和show方法即可.

  7. jquery 文字滚动大全 scroll 支持文字或图片 单行滚动 多行滚动 带按钮控制滚动

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. jquery控制css的display(控制元素的显示与隐藏)

    使用jquery控制div的显示与隐藏: $("#div的id").show()表示display:block, $("#div的id").hide()表示di ...

  9. jquery控制左右箭头滚动图片列表

    jquery控制左右箭头滚动图片列表的实例. 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&q ...

随机推荐

  1. choop.php一句话脚本

    <?php$_="";$_[+$_]++;$_=$_.""; $___=$_[+""];//A$____=$___;$____++;/ ...

  2. jdbc工具类封装

    封装 package util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Prepared ...

  3. Python ValueError: IO operation on closed file

    ValueError IO operation on closed file表示处理了已经被关闭的数据,在python 中 with语句的上下文会帮助处理,也就是说,当python的处理代码不对齐的时 ...

  4. SaltStack与ZeroMQ(二)

    SaltStack与ZeroMQ SaltStack底层是基于ZeroMQ进行高效的网络通信. ZeroMQ简介 ØMQ (也拼写作ZeroMQ,0MQ或ZMQ)是一个为可伸缩的分布式或并发应用程序设 ...

  5. Objective -C学习笔记之字典

    //字典:(关键字 值) // NSArray *array = [NSArray array];//空数组 // NSDictionary *dictionary = [NSDictionary d ...

  6. myeclipse+tomcat内存溢出

  7. re正则表达式16_managing complex regexes

    Managing Complex Regexes Regular expressions are fine if the text pattern you need to match is simpl ...

  8. super 要点

    class Grandparent { public Grandparent() { System.out.println("GrandParent Created."); } p ...

  9. Java——UDP

    import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; //===== ...

  10. python中的not具体使用及意思

    python中的not具体使用及意思 name='' while not name: name=raw_input(u'请输入姓名:') print name python中的not具体表示是什么: ...