js的代码改为jQuery要怎么写
onload=function(){/*语言块的位置*/varhideLeft=document.getElementsByClassName('head-languag...
onload = function(){
/*语言块的位置*/
var hideLeft=document.getElementsByClassName('head-language')[0].offsetLeft;
var hideTop=document.getElementsByClassName('head-language')[0].offsetTop;
/*标记*/
var flag = 1;
/*注册语言块的点击事件*/
document.getElementsByClassName('head-language')[0].onclick = function(){
var languageDiv = document.getElementsByClassName('head-language-hide')[0];
if(flag%2==1)
{
languageDiv.style.display = 'block';
languageDiv.style.left = hideLeft-65+'px';
languageDiv.style.top = '26px';
}
if(flag%2==0)
{
languageDiv.style.display = 'none';
}
flag++;
};
}; 展开
/*语言块的位置*/
var hideLeft=document.getElementsByClassName('head-language')[0].offsetLeft;
var hideTop=document.getElementsByClassName('head-language')[0].offsetTop;
/*标记*/
var flag = 1;
/*注册语言块的点击事件*/
document.getElementsByClassName('head-language')[0].onclick = function(){
var languageDiv = document.getElementsByClassName('head-language-hide')[0];
if(flag%2==1)
{
languageDiv.style.display = 'block';
languageDiv.style.left = hideLeft-65+'px';
languageDiv.style.top = '26px';
}
if(flag%2==0)
{
languageDiv.style.display = 'none';
}
flag++;
};
}; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询