htmltip提示框的简单介绍
华为云服务器特价优惠火热进行中! 2核2G2兆仅需 38 元;4核4G3兆仅需 79 元。购买时间越长越优惠!更多配置及优惠价格请咨询客服。
合作流程: |
今天给各位分享htmltip提示框的知识,其中也会对进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
微信号:cloud7591如需了解更多,欢迎添加客服微信咨询。
复制微信号
本文目录一览:
- 1、点击输入框,旁边出现提示语
- 2、微信小程序如何实现消息提示框
- 3、输入框输入错误后,出现错误提示的红线框和浮动tip层如何做到
- 4、制作网页中超链接如何显示提示?
- 5、怎么设置layer tips弹出位置
- 6、html/js 使用marquee标签,怎么可以做到无缝滚动
点击输入框,旁边出现提示语
这需要和脚本配合,下面是简单示例,当你鼠标点文本框后,出现对应提示,如过输入内容提示去掉。
script
function checkvalue(n,obj)
{ var oTip = document.getElementById("tip"+n);
if (obj.value=="")
{ oTip.innerHTML =obj.title ;}
else
{oTip.innerHTML ="";}
}
/script
p
用户:input type=text name=usename id=username value="" onclick="checkvalue(1,this);" onkeyup="checkvalue(1,this);" title="请输入用户名, 不能空。"label id="tip1"/label
p
密码:input type=password name=pwd id=pwd value="" onclick="checkvalue(2,this);" onkeyup="checkvalue(2,this);" title="请输入密码, 不能空。"label id="tip2"/label
微信小程序如何实现消息提示框
微信小程序开发中toast也是重要的消息提示方式.
提示框:
wx.showToast(OBJECT)
显示消息提示框
OBJECT参数说明:
示例代码:
?
12345
wx.showToast({ title:'成功', icon:'success', duration: 2000})
wx.hideToast()
隐藏消息提示框
?
123456789
wx.showToast({ title:'加载中', icon:'loading', duration: 10000}) setTimeout(function(){ wx.hideToast()},2000)
wx.showModal(OBJECT)
显示模态弹窗
OBJECT参数说明:
示例代码:
?
123456789
wx.showModal({ title:'提示', content:'这是一个模态弹窗', success:function(res) { if(res.confirm) { console.log('用户点击确定') } }})
wx.showActionSheet(OBJECT)
显示操作菜单
OBJECT参数说明:
success返回参数说明:
示例代码:
?
12345678
wx.showActionSheet({ itemList: ['A','B', 'C'], success:function(res) { if(!res.cancel) { console.log(res.tapIndex) } }})
设置导航条
view提示:{{tip}}/view
button type="default" bindtap="showModal"点击我弹出modal对话框/button
view
modal title="modal对话框" hidden="{{modalHidden}}" confirm-text="确定" cancel-text="取消"
bindconfirm="modalBindaconfirm" bindcancel="modalBindcancel"您好,我是modal对话框/modal
/view
Page({
data:{
// text:"这是一个页面"
tip:'',
buttonDisabled:false,
modalHidden:true,
show:false
},
showModal:function(){
this.setData({
modalHidden:!this.data.modalHidden
})
},
modalBindaconfirm:function(){
this.setData({
modalHidden:!this.data.modalHidden,
show:!this.data.show,
tip:'您点击了【确认】按钮!',
buttonDisabled:!this.data.buttonDisabled
})
},
modalBindcancel:function(){
this.setData({
modalHidden:!this.data.modalHidden,
tip:'您点击了【取消】按钮!'
})
}
})
wx.setNavigationBarTitle(OBJECT)
动态设置当前页面的标题。
OBJECT参数说明:
示例代码:
?
123
wx.setNavigationBarTitle({ title:'当前页面'})
wx.showNavigationBarLoading()
在当前页面显示导航条加载动画。
wx.hideNavigationBarLoading()
隐藏导航条加载动画。
页面跳转:
wx.navigateTo(OBJECT)
保留当前页面,跳转到应用内的某个页面,使用wx.navigateBack可以返回到原页面。
OBJECT参数说明:
示例代码:
?
123
wx.navigateTo({ url:'test?id=1'})
?
123456
//test.jsPage({ onLoad:function(option){ console.log(option.query) }})
注意:为了不让用户在使用小程序时造成困扰,我们规定页面路径只能是五层,请尽量避免多层级的交互方式。
wx.redirectTo(OBJECT)
关闭当前页面,跳转到应用内的某个页面。
OBJECT参数说明:
示例代码:
?
123
wx.redirectTo({ url:'test?id=1'})
wx.navigateBack(OBJECT)
关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages()) 获取当前的页面栈,决定需要返回几层。
OBJECT参数说明:
动画:
wx.createAnimation(OBJECT)
创建一个动画实例animation。调用实例的方法来描述动画。最后通过动画实例的export方法导出动画数据传递给组件的animation属性。
注意: export 方法每次调用后会清掉之前的动画操作
OBJECT参数说明:
?
123456
var animation = wx.createAnimation({ transformOrigin:"50% 50%", duration: 1000, timingFunction:"ease", delay: 0})
animation
动画实例可以调用以下方法来描述动画,调用结束后会返回自身,支持链式调用的写法。
样式:
旋转:
缩放:
偏移:
倾斜:
矩阵变形:
动画队列
调用动画操作方法后要调用 step() 来表示一组动画完成,可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。step 可以传入一个跟 wx.createAnimation() 一样的配置参数用于指定当前组动画的配置。
示例:
?
1
viewanimation="{{animationData}}"style="background:red;height:100rpx;width:100rpx"/view
?
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
Page({ data: { animationData: {} }, onShow:function(){ varanimation = wx.createAnimation({ duration: 1000, timingFunction:'ease', }) this.animation = animation animation.scale(2,2).rotate(45).step() this.setData({ animationData:animation.export() }) setTimeout(function() { animation.translate(30).step() this.setData({ animationData:animation.export() }) }.bind(this), 1000) }, rotateAndScale:function () { // 旋转同时放大 this.animation.rotate(45).scale(2, 2).step() this.setData({ animationData:this.animation.export() }) }, rotateThenScale:function () { // 先旋转后放大 this.animation.rotate(45).step() this.animation.scale(2, 2).step() this.setData({ animationData:this.animation.export() }) }, rotateAndScaleThenTranslate:function () { // 先旋转同时放大,然后平移 this.animation.rotate(45).scale(2, 2).step() this.animation.translate(100, 100).step({ duration: 1000 }) this.setData({ animationData:this.animation.export() }) }})
wx.hideKeyboard()
收起键盘。
输入框输入错误后,出现错误提示的红线框和浮动tip层如何做到
就是一个div浮动层然后用js定位来实现的
具体可以参考下面这个定位提示效果
制作网页中超链接如何显示提示?
一、显示静态文本信息
效果:鼠标移动到超链接上时,显示出文本提示信息。
制作方法:利用超链接标记中的TITLE属性来实现。
例如:<a href="" title="中国最大的中文IT垂直网站">天极网</a>
二、显示动态文本信息
效果:鼠标移动到超链接上时,显示出滚动的文本提示信息,就像我们经常见到的跑马灯一样。
制作方法:这个效果利用了JavaScript,将下面这段代码复制到网页中:
<script>
if (!document.layers!document.all)
event="test"
function showtip2(current,e,text){
if (document.alldocument.readyState=="complete"){
document.all.tooltip2.innerHTML="<marquee style="border:1px solid black">"+text+"</marquee>"
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}
else if (document.layers){
document.tooltip2.document.nstip.document.write("<b>"+text+"</b>")
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}
function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
</script>
<div id="tooltip2"
style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow"><layer name="nstip" width="1000px" bgColor="lightyellow">
</layer>
</div>
超链接的样式如:
<a href="" onMouseover="showtip2(this,event,"中国最大的中文IT垂直网站!内容非常丰富多采")" onMouseout="hidetip2()">天极网</a>
三、在状态栏显示提示信息
效果:鼠标移动到超链接上时,会在状态栏中显示出提示信息。
制作方法:例子如下所示,将下面这段代码复制到网页中,把网址和说明文字改成你需要的即可。
<a href="" onmouseover="window.status="中国最大的中文IT垂直网站!内容非常丰富!";return true" onmouseout="window.status="";return true">天极网</a>

怎么设置layer tips弹出位置
1、打开前端开发工具,新建一个html代码页面。
2、找打页面上的title标签,在这个标签后面使用link链接一个外部样式layer.css文件。
3、在链接的layer.css文件后面插入外部的jquery.js、layer.js这两个外部文件。
4、创建弹出框。创建一个新的script标签,然后在这个标签里面使用layer.open()创建弹出框功能。
5、查看弹出框效果。保存html代码文件后使用浏览器打开,这个时候看到弹出框已经功能已经实现。
6、修改弹出框大小。在layer.opren()方法里面使用area:[]设置弹出框的宽/高。
7、保存html代码后重新刷新浏览器页面,即可看到弹出框的大小已被修改。
html/js 使用marquee标签,怎么可以做到无缝滚动
需要js的配合一下是一个非常好用的一个html代码,可以试试
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
""
HTML xmlns=""
HEAD
TITLE一行多列文字循环滚动带停顿-/TITLE
meta name="keywords" content="网页特效" /
meta name="description" content="" /
META http-equiv=Content-Type content="text/html; charset=utf-8"
style type="text/css"
ul {height:200px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
margin: 0px;
padding-top: 0px
}
#announcement {
width:300px;
height:200px;
background:url(img/menu_bg.gif) repeat;
overflow: hidden;
}
#announcement div {
border: #e6e6e6 1px solid;
padding:0px 10px 0px 10px;
overflow-y:hidden;
line-height: 24px;
height:100px;
}
#announcement li {
font-size: 12px;
float: left;
list-style-type: none;
margin-right: 20px;
padding-left: 10px;
background: url(img/arrow_right.gif) no-repeat 0px 50%;
white-space: nowrap
}
#announcement a {
text-decoration: none;
}
#announcement a:hover {
text-decoration:underline;
}
/style
/HEAD
BODY
DIV id="announcement" onMouseOver="if(!anncount) {clearTimeout(annst);annst = 0}" onMouseOut="if(!annst) annst = setTimeout('announcementScroll()', anndelay);"
DIV id="scrbody"
ul
li
a href="#" target="_blank"jQuery 类似腾讯网的图片幻灯特效(可自动播放)/a
/li
li
a href="#/JS" target="_blank"VB版增强型Windows任务管理器/a
/li
li
a href="#/JS/texiao"target="_blank"JQuery Tip多风格链接提示框/a
/li
li
a href="#/JS/ad" target="_blank"VC++动态加载、调用smtp.dll发邮件示例/a
/li
li
a href="#/html+css" target="_blank"++连连看游戏源码附外挂/a
/li
li
a href="#/" target="_blank"基于API的VB HOOK钩子拦截程序/a
/li
li
a href="#/" target="_blank"VB 操作系统的一些常用小技巧集/a
/li
li
a href="#/js" target="_blank"xTree 标准的WEB菜单树(树形菜单)/a
/li
/ul
/DIV
/DIV
script type="text/javascript"
function $(id)
{
return document.getElementById(id);
}
var anndelay = 3000;
var anncount = 0;
var annheight = 24;
var annst = 0;
function announcementScroll()
{
if( ! annst)
{
$('scrbody').innerHTML += 'br style="clear: both" /' +
$('scrbody').innerHTML;
$('scrbody').scrollTop = 0;
if($('scrbody').scrollHeight annheight * 3)
{
annst = setTimeout('announcementScroll()', anndelay);
}
else
{
$('announcement').onmouseover = $('announcement').onmouseout = null;
}
return;
}
if(anncount == annheight)
{
if($('scrbody').scrollHeight - annheight = $('scrbody').scrollTop)
{
$('scrbody').scrollTop = $('scrbody').scrollHeight / 2 - annheight;
}
anncount = 0;
annst = setTimeout('announcementScroll()', anndelay);
}
else
{
$('scrbody').scrollTop ++ ;
anncount ++ ;
annst = setTimeout('announcementScroll()', 10);
}
}
announcementScroll();
/script
/BODY
/HTML
htmltip提示框的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于、htmltip提示框的信息别忘了在本站进行查找喔。
