Javascript 鼠标悬停脚本不工作。。。需要帮助吗

Javascript 鼠标悬停脚本不工作。。。需要帮助吗,javascript,events,Javascript,Events,有人可以试试这个,看看它是否适合你。我想不出这个问题。。也许我在什么地方发生了冲突。使用jquery 非常感谢你的帮助 <script type="text/javascript"> $(document).ready(function(){ $('a').mouseover(function() { switch ($(this).attr('class')) { case 'nc1': new_content = 'Twitter'; brea

有人可以试试这个,看看它是否适合你。我想不出这个问题。。也许我在什么地方发生了冲突。使用jquery

非常感谢你的帮助

  <script type="text/javascript">
  $(document).ready(function(){
  $('a').mouseover(function() {
  switch ($(this).attr('class')) {
  case 'nc1':
    new_content = 'Twitter';
    break;

  case 'nc2':
    new_content = 'Facebook';
    break;

  case 'nc3':
    new_content = 'Linked In';
    break;

  case 'nc4':
    new_content = 'Flickr';
    break;
  case 'nc5':
    new_content = 'RSS Feed';
    break;

  case 'cs1':
    new_content = 'Email';
    break;
  case 'cs2':
    new_content = 'Telephone';
    break;

  case 'cs3':
    new_content = 'Live Chat';
    break;

  case 'cs4':
    new_content = 'Skype';
    break;

  case 'cs5':
    new_content = 'Google Voice';
    break;

  default:
    new_content = 'The crusade to feed every orphan in the world';
    break;
  }

  $('#ms').html(new_content)
  }).mouseout(function() {
  $('#ms').text('The crusade to feed every orphan in the world');
  });});
  </script>




  <div id="ms">The crusade to feed every orphan in the world.</div>

  <div id="nc_wrap2">
  <a class="nc1" href="#"></a>
  <a class="nc2" href="#"></a>
  <a class="nc3" href="#"></a>
  <a class="nc4" href="#"></a>
  <a class="nc5" href="#"></a>
  </div>

$(文档).ready(函数(){
$('a').mouseover(函数(){
开关($(this.attr('class')){
个案‘nc1’:
新内容='推特';
打破
个案"nc2":
新内容='Facebook';
打破
个案"nc3":
新内容='链接在';
打破
个案‘nc4’:
新内容='Flickr';
打破
个案‘nc5’:
新内容='RSS提要';
打破
案例“cs1”:
新内容=‘电子邮件’;
打破
案例“cs2”:
新内容=‘电话’;
打破
案例“cs3”:
新内容=‘现场聊天’;
打破
案例“cs4”:
新内容='Skype';
打破
案例“cs5”:
新内容='谷歌语音';
打破
违约:
新内容=‘喂养世界上每一个孤儿的十字军东征’;
打破
}
$('#ms').html(新内容)
}).mouseout(函数(){
$(“#ms”).text(“喂养世界上每一个孤儿的十字军东征”);
});});
为全世界所有孤儿提供食物的十字军东征。
如果您在链接中添加了一些内容,则效果很好


的示例中,我发现了与以下内容的冲突:$(document.ready(function(){$.preload.cssimages();})@Erik,你评论中的代码没有出现在问题的代码中。。我想你的风格是用css设计的,并且有图像背景?