jQuery版本为1.3的
两个jQuery顺序为第一个jQuery验证登陆,第二个网页内容鼠标滑动效果第二个jQuery不起作用(当鼠标移到boxA,隐藏的对应boxB并没有显示出来),如果不起用第一个jQuery,则第二个起作用,请问如何修改第二个jQuery的代码,让其能实现鼠标滑动显示内容boxB效果。程序在登陆使用了固定格式ajax,代码如下:
<script type="text/javascript">
 function ShowPopLogin()
 {    
    var p=new Popup();
p.MsgBorder=1;
p.ShowBackground=false;
p.BgColor='#fff';
p.TitleCss="font-size:14px;background:#008C6A;color:#fff;height:22px;";
    p.popup("<img src='/user/images/icon18.png' align='absmiddle'>会员登录","<form action='/user/checkuserlogin.asp' method='post' name='myform'><div id='showloginform' style='background:url(/user/images/loginbg.png) repeat-x;'>加载中...</div></form>",450);
  jQuery.getScript("/user/userlogin.asp?action=PoploginStr",function(){
    jQuery("#showloginform").html(userpop.str);
  });
 }
function getCode(){
 document.getElementById('showVerify').innerHTML='<IMG style="cursor:pointer" src="/plus/verifycode.asp" onClick="this.src=\'/plus/verifycode.asp?n=\'+ Math.random();" align="absmiddle">';
}
function CheckLoginForm(){
var username=document.myform.Username.value;
var pass=document.myform.Password.value;
if (username==''){
  alert('请输入用户名');
  document.myform.Username.focus();
  return false;}
if (pass==''){
  alert('请输入登录密码');
  document.myform.Password.focus();
  return false;
 }
  return true;

jQuery(document).ready(function(){
  jQuery.getScript("/user/userlogin.asp?action=checklogin&s=1",function(){
    jQuery("#showuserlogin").html(user.loginstr);
  });
  })
 </script>
 <span id="showuserlogin"><img src="/images/loading.gif" align="absmiddle" alt=""/>加载中...</span>
第二个jQuery代码为: <SCRIPT type=text/javascript>
jQuery(function($){
var accordion={
id:$("#contentAa .left"),
init:function(){
var that=this;
this.id.find("> .boxA").each(function(i){
$(this).mouseenter(function(){
that.id.find("> .boxA").show();
$(this).hide();
that.id.find("> .boxB").hide().eq(i).show().css("opacity",0).animate({"opacity":1},200)
})
}).eq(0).mouseenter();
}
}.init()
})
</SCRIPT>
目标内容为
<DIV class=area id=contentAa>
<DIV class=left>
<DIV class=boxB>
内容1</DIV>
<DIV class=boxA>内容 1</DIV>
<DIV class=boxB>
内容2</DIV>
<DIV class=boxA>内容2/DIV>
<DIV class=boxB>
内容3</DIV>
<DIV class=boxA>内容3/DIV>
<DIV class=boxB>
内容4</DIV>
<DIV class=boxA>内容4/DIV>
</DIV>
</DIV>

解决方案 »

  1.   

    jQuery(document).ready(function(){
              jQuery.getScript("/user/userlogin.asp?action=checklogin&s=1",function(){
                jQuery("#showuserlogin").html(user.loginstr);
              });          var accordion={
            id:$("#contentAa .left"),
            init:function(){
                var that=this;            
                this.id.find("> .boxA").each(function(i){
                    $(this).mouseenter(function(){
                        that.id.find("> .boxA").show();
                        $(this).hide();
                        that.id.find("> .boxB").hide().eq(i).show().css("opacity",0).animate({"opacity":1},200)
                    })
                }).eq(0).mouseenter();
            }
        }.init()      })
    把第二个代码放在第一个ready函数里试试
      

  2.   

    这个还是自己慢慢调试吧,加入一些alert语句在你的JS代码,看看程序的执行是不是像你想象中的那样。