幻灯片菜单栏无法在IE 10上运行 [英] Slide Menu Bar not working on IE 10

查看:61
本文介绍了幻灯片菜单栏无法在IE 10上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨每一个,

现在我正在将IE 8的版本更新到IE 10所以现在这里的问题是幻灯片菜单栏不能在IE 10下面附加我的代码请给我一些想法什么要做。



< script language =JavaScript1.2>

ie = document.all?1:0

n = document.layers?1:0

ns6 = document.getElementById&&!document.all?1:0



//这些是您必须设置的变量:



//当它在图层中时,您有多少可见out state?

lshow = 12



//每步移动多少像素?

var move = 10;



//以什么速度(以毫秒为单位,更低的值是更快的速度)

menuSpeed = 40



//如果用户滚动页面,您是否希望它随页面移动?

var moveOnScroll = false



/ ******************************** *******

您不必在此以下更改任何内容。

**************** ************************ /

//定义变量



var ltop;

var tim = 0;



//对象构造函数

函数makeMenu( obj,nest){

nest =(!nest)< 0? '':'document。'+ nest +'。'

if(n)this.css = eval(nest +'document。'+ obj)

else if(ns6 )this.css = document.getElementById(obj).style

else if(ie)this.css = eval(obj +'。style')

this.state = 1

this.go = 0

if(n)this.width = this.css.document.width

else if(ns6) this.width = document.getElementById(obj).offsetWidth

else if(ie)this.width = eval(obj +'。offsetWidth')

this.left = b_getleft

this.obj = obj +Object; eval(this.obj += this)

}

//获得最高位置。

function b_getleft(){

if(n || ns6){gleft = parseInt(this.css.left)}

else if(ie){gleft = eval(this.css.pixelLeft)}

返回gleft;

}

/ ********************* **************

决定移动菜单的方式(这叫做onmouseover,onmouseout或onclick)

function moveMenu( ){

if(!oMenu.state){

clearTimeout(tim)

mIn()

}否则{

clearTimeout(蒂姆)

mOut()

}

}

//菜单在

函数mIn(){

if(oMenu.left()> -oMenu.width + lshow){

oMenu.go = 1

oMenu.css.left = oMenu.left() - move

tim = setTimeout(mIn(),menuSpeed)

}否则{

oMenu.go = 0

oMenu.state = 1

}

}

//菜单输出

函数mOut(){
if(oMenu.left()< 0){

oMenu.go = 1

oMenu.css.left = oMenu.left( )+ move

tim = setTimeout(mOut(),menuSpeed)

}否则{

oMenu.go = 0
oMenu.state = 0

}

}

/ ************* ********************

检查页面是否滚动,是否在

之后移动菜单function checkScrolled(){

if(!oMenu.go)oMenu.css.top = eval(scrolled)+ parseInt(ltop)

if(n || ns6) setTimeout('checkScrolled()',30)

}

/ ********************** ***********

进入页面,制作菜单对象,将其移动到正确的位置,

显示它

********************************** /

function menuInit() {

oMenu = new makeMenu('divMenu')

if(n || ns6)scrolled =window.pageYOffset

else if (即)scrolled =document.body.scrollTop

oMenu.css.left = -oMenu.width + lshow

if(n || ns6)ltop = oMenu.css.top

else if(ie)ltop = oMenu.css.pixelTop

oMenu.css。 visibility ='visible'

if(moveOnScroll)ie?window.onscroll = checkScrolled:checkScrolled();

}



//页面加载的内容菜单

窗口。 önload= menuInit;



< / script>



这里调用这样的脚本< br $>


< img src =../ Images / menu / arrow.gifborder =0/ > 谢谢

Harsha。

解决方案

嗨朋友



i更新了jquery然后终于它正在工作。



< script src =../js / jquery-1.4.1.min.jstype =文本/ JavaScript的>< /脚本>

Hi every one,
Now i am working version update to IE 8 to IE 10 so now here problem is slide menu bar not working on IE 10 below attaching my code please give me some idea what to do.

<script language="JavaScript1.2">
ie=document.all?1:0
n=document.layers?1:0
ns6=document.getElementById&&!document.all?1:0

//These are the variables you have to set:

//How much of the layer do you wan't to be visible when it's in the out state?
lshow=12

//How many pixels should it move every step?
var move=10;

//At what speed (in milliseconds, lower value is more speed)
menuSpeed=40

//Do you want it to move with the page if the user scroll the page?
var moveOnScroll=false

/***************************************
You should't have to change anything below this.
****************************************/
//Defining variables

var ltop;
var tim=0;

//Object constructor
function makeMenu(obj,nest){
nest=(!nest)< 0 ? '':'document.'+nest+'.'
if (n) this.css=eval(nest+'document.'+obj)
else if (ns6) this.css=document.getElementById(obj).style
else if (ie) this.css=eval(obj+'.style')
this.state=1
this.go=0
if (n) this.width=this.css.document.width
else if (ns6) this.width=document.getElementById(obj).offsetWidth
else if (ie) this.width=eval(obj+'.offsetWidth')
this.left=b_getleft
this.obj = obj + "Object"; eval(this.obj + "=this")
}
//Get's the top position.
function b_getleft(){
if (n||ns6){ gleft=parseInt(this.css.left)}
else if (ie){ gleft=eval(this.css.pixelLeft)}
return gleft;
}
/***********************************
Deciding what way to move the menu (this is called onmouseover, onmouseout or onclick)
function moveMenu(){
if(!oMenu.state){
clearTimeout(tim)
mIn()
}else{
clearTimeout(tim)
mOut()
}
}
//Menu in
function mIn(){
if(oMenu.left()>-oMenu.width+lshow){
oMenu.go=1
oMenu.css.left=oMenu.left()-move
tim=setTimeout("mIn()",menuSpeed)
}else{
oMenu.go=0
oMenu.state=1
}
}
//Menu out
function mOut(){
if(oMenu.left()<0){
oMenu.go=1
oMenu.css.left=oMenu.left()+move
tim=setTimeout("mOut()",menuSpeed)
}else{
oMenu.go=0
oMenu.state=0
}
}
/*********************************
Checking if the page is scrolled, if it is move the menu after
function checkScrolled(){
if(!oMenu.go) oMenu.css.top=eval(scrolled)+parseInt(ltop)
if(n||ns6) setTimeout('checkScrolled()',30)
}
/*********************************
Inits the page, makes the menu object, moves it to the right place,
show it
**********************************/
function menuInit(){
oMenu=new makeMenu('divMenu')
if (n||ns6) scrolled="window.pageYOffset"
else if (ie) scrolled="document.body.scrollTop"
oMenu.css.left=-oMenu.width+lshow
if (n||ns6) ltop=oMenu.css.top
else if (ie) ltop=oMenu.css.pixelTop
oMenu.css.visibility='visible'
if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}

//Initing menu on pageload
window. önload=menuInit;

</script>

"here calling the script like this"

<img src="../Images/menu/arrow.gif" border="0"/>Thanks
Harsha.

解决方案

Hi Friends

i am updated jquery then finally it's working .

<script src="../js/jquery-1.4.1.min.js" type="text/javascript"></script>


这篇关于幻灯片菜单栏无法在IE 10上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆