質問

私はjQueryのカラーボックスは、マウスのホバーとマウスアウトに近い上の画像を開きたいです。 私はそれを行うことができますどのようにアドバイスすることはできますか?

役に立ちましたか?

解決

これは、あなたが始めることができ...

HTML

<img src="a.jpg" alt="b" />

jQueryの

$('img').hover(function() {
    $(this).stop().animate({ width: '170%' }, 500);
}, function() {
    $(this).stop().animate({ width: '100%' }, 500);
});

他のヒント

私はこのような何かをするだろう

 $(function(){
  function fatOnHover($elements, zoomSize, animationSpeed){
  $elements.each(function(i){
     var $wrap, height, width, bigWidth, bigHeight, $that = $(this);
     height = $that.height();
     width = $that.width();
     bigWidth = (width / 100) * zoomSize;
     bigHeight = (height / 100) * zoomSize;
      $wrap = "<div style='z-index: " + (10000-i) +";width: " + width + "px; height: " + height + "px; position: relative; float: left'></div>",
      $that.data({"width": width, "height": height, "bigWidth": bigWidth, "bigHeight": bigHeight})
          .wrap($wrap)
   }).hover(
     function(){
        var $that = $(this);
        $that.stop().animate({"width": $that.data("bigWidth"), "height": $that.data("bigHeight")}, animationSpeed)
     },
     function(){
        var $that = $(this);
        $that.stop().animate({"width": $that.data("width"), "height": $that.data("height")}, animationSpeed)
     }
  ).css("position", "absolute")
   }


fatOnHover($('img'), 120, 300)
})

あなたはここでそれをテストすることができます: http://jsfiddle.net/GHuNF/1/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top