谁有鼠标划过图片,图片会放大(在另一个层)的js代码,不是直接在同样一个页面上方法

解决方案 »

  1.   

    jquery tooltip 
    demo地址:http://jquery.bassistance.de/tooltip/demo/ 
      

  2.   

    在另一个层里放大?
    <div><img src="a.gif" width="100" height="100"></div>
    <div><img src="a.gif" width="200" height="200"></div>
    onmouseover让第一个层隐藏第二个层显示
    是这个意思不
      

  3.   

    不是,大图是在一个层上面现实类似http://search1.taobao.com/browse/0/n-7----------------------0-----------------------g,xovm5krag4ytama-------2-------b--40--bid-0-all-0.htm?ab=ABTestA&ssid=s1 
    鼠标滑过图片的效果
      

  4.   

    //以下代码需要jquery.js
    $.fn.floatWith = function(obj,idx){
    idx = typeof(idx)!='number' || !idx ? 0 : idx;
    var elem = $(obj),offset = elem.offset(),_top = offset.top,_left =offset.left,width = elem.outerWidth(),height=elem.outerHeight();
    var floatWidth = this.outerWidth(), floatHeight = this.outerHeight(), cssPos = null;
    switch(idx){
    case 0: cssPos = {top:_top+height,left:_left}; break;
    case 1: cssPos = {top:_top+height,left:_left+width}; break;
    case 2: cssPos = {top:_top,left:_left+width}; break;
    case 3: cssPos = {top:_top-floatHeight,left:_left+width}; break;
    case 4: cssPos = {top:_top-floatHeight,left:_left}; break;
    case 5: cssPos = {top:_top-floatHeight,left:_left-floatWidth}; break;
    case 6: cssPos = {top:_top,left:_left-floatWidth}; break;
    case 7: cssPos = {top:_top+height,left:_left-floatWidth}; break;
    default:cssPos = {top:_top+height,left:_left}; break;
    }
    this.eq(0).css({'position':'absolute'}).css(cssPos).hide().show(200);
    return this;
    };