簡體   English   中英

用Jquery調用Javascript函數

[英]Call a Javascript Function with Jquery

我在Javascript中有兩個功能:

function getWindowWidth(){
var x = 0;
if (self.innerHeight){
x = self.innerWidth;
}else if (document.documentElement && document.documentElement.clientHeight){
x = document.documentElement.clientWidth;
}else if (document.body){
x = document.body.clientWidth;
}return x;
}function getWindowHeight(){
var y = 0;
if (self.innerHeight){
y = self.innerHeight;
}else if (document.documentElement && document.documentElement.clientHeight){
y = document.documentElement.clientHeight;
}else if (document.body){
y = document.body.clientHeight;
}

這些看起來是根據窗口的大小來設置文檔窗口的高度和寬度嗎? 我在這里可能是錯的...

我所做的是在此文檔上方嵌入了一個工具欄,該工具欄可以隱藏或顯示在各個位置。

使用以下jQuery時,我需要調用上述函數,

$("#Main").animate({top: "89px"}, 200);

任何幫助,不勝感激!

animate()采用回調函數。

$("#Main").animate({top: "89px"}, 200, function() {
    getWindowWidth(); 
    getWindowHeight(); });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM