操作网页中的部分 - 创建、扩展

发布于 2024-12-21 12:59:42 字数 198 浏览 2 评论 0原文

我有 3 个问题:

如何在网页中创建不同的部分 - 例如 Gmail?

在设计 HTML/Javascript 页面时,如果您检查 Gmail,将鼠标指向收件箱,展开该部分,然后将鼠标移至右侧,将其返回到相同的位置 - 如何做到这一点?他们使用了什么技术?

他们的滚动条有同样的问题 - 如何将普通滚动条的样式更改为我想要的不同样式?

I have 3 questions:

How do I create different sections in a web-page - like in say, Gmail?

In designing HTML/Javascript pages, If you check Gmail, pointing your mouse over Inbox, expands that section, then bringing the mouse to the right returns it to the same - how to do that? What technology did they use?

Same question for their scroll bars - how do I change the style of the normal-scroll bar to a different style that I would like?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光是把杀猪刀 2024-12-28 12:59:42

首先,您可以将组划分为 div,因此得名。但是 Javascript 有一个相当简单的代码,这是我使用的整个代码

<p align="center" class="style1"><script language="JavaScript1.2">

var tickercontents=new Array()
tickercontents[0]='<strong>(text here)</strong></a>'
tickercontents[1]='<strong>(text here)</strong><a>'
tickercontents[2]='<strong>(text here)</strong><a>'


//configure the below 2 variables to set the width/background color of the ticker
var tickerwidth='760px'
var tickerbgcolor='#CC66FF'

//configure the below variable to determine the delay between ticking of messages (in         miliseconds)
var tickdelay=6000

////Do not edit past this line////////////////

var ie4=document.all
var ns6=document.getElementById
var ns4=document.layers

var currentmessage=0
var tickercontentstotal=''

function changetickercontent(){
if (ns4){
tickerobj.document.tickernssub.document.write('<b><a href="#" onClick="return      expandlist(event)">Expand</a></b> | '+tickercontents[currentmessage])
tickerobj.document.tickernssub.document.close()
}
else if (ie4||ns6){
tickerobj.innerHTML=tickercontents[currentmessage]
previousmessage=(currentmessage==0)? tickercontents.length-1 : currentmessage-1
tickerexpand_item=ns6? document.getElementById("expand"+currentmessage) :             eval("expand"+currentmessage)
tickerexpand_previousitem=ns6? document.getElementById("expand"+previousmessage) :     eval("expand"+previousmessage)
tickerexpand_previousitem.className=""
tickerexpand_item.className="expandhighlight"
}

currentmessage=(currentmessage==tickercontents.length-1)? 0 : currentmessage+1
setTimeout("changetickercontent()",tickdelay)
}

function start_ticking(){
if (ns4) document.tickernsmain.visibility="show"
tickerobj=ie4? tickerlist : ns6? document.getElementById("tickerlist") : ns4?     document.tickernsmain : ""
tickerexpandobj=ie4? tickerexpand : ns6? document.getElementById("tickerexpand") : ns4?     document.expandlayer : ""

for (i=0;i<tickercontents.length;i++) //get total scroller contents
tickercontentstotal+='<div id="expand'+i+'">- '+tickercontents[i]+'</div>'
if (ie4||ns6)
tickerexpandobj.innerHTML=tickercontentstotal
else{
tickerexpandobj.document.write(tickercontentstotal)
tickerexpandobj.document.close()
}
changetickercontent()
}

function expandlist(e){
if (ie4||ns6){
tickerexpand_parent=ie4? tickerexpand.parentElement :         document.getElementById("tickerexpand").parentNode
tickerexpand_parent.style.display=(tickerexpand_parent.style.display=="none")? "" :     "none"
}
else{
document.expandlayer.left=e.pageX-e.layerX
document.expandlayer.top= e.pageY-e.layerY+20
document.expandlayer.visibility=(document.expandlayer.visibility=="hide")? "show" :     "hide"
return false
}
}

if (ie4||ns6)
document.write('<table border="0" style="width:'+tickerwidth+';border:1px solid     black;text-indent:2px" bgcolor="'+tickerbgcolor+'" cellspacing="0" cellpadding="0"><tr><td     width="90%" id="tickerlist" bgcolor="'+tickerbgcolor+'"></td><td width="10%"     bgcolor="'+tickerbgcolor+'"><div id="listbutton" onClick="expandlist()">Expand</div></td>    </tr><tr style="display:none"><td id="tickerexpand" width="90%" bgcolor="'+tickerbgcolor+'">     </td><td width="10%"></td></tr></table>')

window.onload=start_ticking
</script>

First you can divide groups into divs hence the name. But Javascript has a fairly simple code this is the entire code I used

<p align="center" class="style1"><script language="JavaScript1.2">

var tickercontents=new Array()
tickercontents[0]='<strong>(text here)</strong></a>'
tickercontents[1]='<strong>(text here)</strong><a>'
tickercontents[2]='<strong>(text here)</strong><a>'


//configure the below 2 variables to set the width/background color of the ticker
var tickerwidth='760px'
var tickerbgcolor='#CC66FF'

//configure the below variable to determine the delay between ticking of messages (in         miliseconds)
var tickdelay=6000

////Do not edit past this line////////////////

var ie4=document.all
var ns6=document.getElementById
var ns4=document.layers

var currentmessage=0
var tickercontentstotal=''

function changetickercontent(){
if (ns4){
tickerobj.document.tickernssub.document.write('<b><a href="#" onClick="return      expandlist(event)">Expand</a></b> | '+tickercontents[currentmessage])
tickerobj.document.tickernssub.document.close()
}
else if (ie4||ns6){
tickerobj.innerHTML=tickercontents[currentmessage]
previousmessage=(currentmessage==0)? tickercontents.length-1 : currentmessage-1
tickerexpand_item=ns6? document.getElementById("expand"+currentmessage) :             eval("expand"+currentmessage)
tickerexpand_previousitem=ns6? document.getElementById("expand"+previousmessage) :     eval("expand"+previousmessage)
tickerexpand_previousitem.className=""
tickerexpand_item.className="expandhighlight"
}

currentmessage=(currentmessage==tickercontents.length-1)? 0 : currentmessage+1
setTimeout("changetickercontent()",tickdelay)
}

function start_ticking(){
if (ns4) document.tickernsmain.visibility="show"
tickerobj=ie4? tickerlist : ns6? document.getElementById("tickerlist") : ns4?     document.tickernsmain : ""
tickerexpandobj=ie4? tickerexpand : ns6? document.getElementById("tickerexpand") : ns4?     document.expandlayer : ""

for (i=0;i<tickercontents.length;i++) //get total scroller contents
tickercontentstotal+='<div id="expand'+i+'">- '+tickercontents[i]+'</div>'
if (ie4||ns6)
tickerexpandobj.innerHTML=tickercontentstotal
else{
tickerexpandobj.document.write(tickercontentstotal)
tickerexpandobj.document.close()
}
changetickercontent()
}

function expandlist(e){
if (ie4||ns6){
tickerexpand_parent=ie4? tickerexpand.parentElement :         document.getElementById("tickerexpand").parentNode
tickerexpand_parent.style.display=(tickerexpand_parent.style.display=="none")? "" :     "none"
}
else{
document.expandlayer.left=e.pageX-e.layerX
document.expandlayer.top= e.pageY-e.layerY+20
document.expandlayer.visibility=(document.expandlayer.visibility=="hide")? "show" :     "hide"
return false
}
}

if (ie4||ns6)
document.write('<table border="0" style="width:'+tickerwidth+';border:1px solid     black;text-indent:2px" bgcolor="'+tickerbgcolor+'" cellspacing="0" cellpadding="0"><tr><td     width="90%" id="tickerlist" bgcolor="'+tickerbgcolor+'"></td><td width="10%"     bgcolor="'+tickerbgcolor+'"><div id="listbutton" onClick="expandlist()">Expand</div></td>    </tr><tr style="display:none"><td id="tickerexpand" width="90%" bgcolor="'+tickerbgcolor+'">     </td><td width="10%"></td></tr></table>')

window.onload=start_ticking
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文