English 中文(简体)
Javascript - 持托托托托托托托托托直到装上页
原标题:Java script - Keep buttons hidden until page load
  • 时间:2010-07-17 10:41:46
  •  标签:
  • javascript

我建立了横向滚动网站。 我确实非常了解贾瓦文,但我下载了这份称为“地平坦图象”的文字,使你能够在不使用滚动条的情况下横向浏览网站。

除文字外,一切都完美地运作,但只有在网页上其他所有东西都填满时,才会装满。 由于我的网站有大量图象,这造成了一种可喜的局面,因为滚动纽子不立即工作。 我对大多数用户的猜测将假定 but子破碎。

在进行了一些研究之后,我发现,在图形之前,没有办法使纽托克装货,因此,我只得躲藏在地纽上,直到该页装满。

The Tiny Scroller script used a document. 登出国的书面通知:

document.writeln( <a href="javascript://" id="left-arrow"></a>
<a href="javascript://" id="right-arrow"></a> );

Using online tutorials, I created two CSS classes: .visible {display:block;} & .hidden {display:none;}. I rewrote the document.writeln command so the buttons were assigned the .hidden class by default:

document.writeln( <a href="javascript://" id="left-arrow" class="hidden"></a>
<a href="javascript://" id="right-arrow" class="hidden"></a> );

最后,我写了<条码>的有效载荷=,以便下载<条码>。 类别:<代码>。

onload=function() {
     document.getElementById( left-arrow ).className= visible ;
     document.getElementById( right-arrow ).className= visible ;
}

http://olo.uk.com/sites/all/themes/olotheme/scripts/one-scroller.js'rel=“nofollow noreferer”>

一切工作都属于罚款,但只有该页装满时才会出现纽扣。 HOWEVER, scrolling function don t work any more! 删除<代码>的有效载荷= 这一切都再次奏效(但随后,各纽州在网页上填满了装货)。

是否有任何人怀疑我干什么错?

最佳回答

你或许会重写图书馆集的手载。 这或许不是实现你需要做的工作的最佳途径,但鉴于你对贾瓦特有新意,我们尝试并努力工作。

改变你的手脚:

function handler() {
    document.getElementById( left-arrow ).className= visible ;
    document.getElementById( right-arrow ).className= visible ;
}

var old_onload = window.onload;
window.onload = function() {
    handler();
    if(old_onload) {
        old_onload();
    }
};

这将检查是否已经安装了上载手,如果已经安装,也不会超出。

问题回答

我建议将link<>/em>至上载,而不是overping/em>。

if(window.attachEvent){ //IE
    window.attachEvent("onload", myChangeVisFunc);
}else{
    window.addEventListener("load", myChangeVisFunc, false);
}




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.