English 中文(简体)
• 如何选择形象
原标题:How to select image with .jpg
  • 时间:2010-12-19 17:19:34
  •  标签:
  • jquery

我是否能够用jpg来瞄准图像?

例如,以下法典扩大了所有形象。 然而,我只想扩大。

/*
 * If a page url contains /art-8 (not cart-8), then do this.
 * Add a link to zoom an image on the first image on a product page  
 */
if (/[^c]art-8/.test(location.pathname)) {

$("#system #product_cont img").wrapAll("<ul class="cont_thumb">").wrap("<li>");
$(".cont_thumb").after("<div style= clear:both;padding-bottom: 20px; ></div> ");



$("ul.cont_thumb li").hover(function(){
    $(this).css({
         z-index :  10 
    });
    $(this).find( img ).addClass("hover").stop().animate({
        marginTop:  0px ,
        marginLeft:  -35px ,
        top:  50% ,
        left:  50% ,
        width:  344px ,
        height:  258px ,
        padding:  0px 
    }, 200);

}, function(){
    $(this).css({
         z-index :  0 
    });
    $(this).find( img ).removeClass("hover").stop().animate({
        marginTop:  0 ,
        marginLeft:  0 ,
        top:  0 ,
        left:  0 ,
        width:  80px ,
        height:  60px ,
        padding:  3px 
    }, 400);
});
最佳回答
问题回答

您可使用<代码>mg [href$=.jpg], img[href$=.jpeg]。

替换

$("ul.cont_thumb li").hover(function(){

iii

$("ul.cont_thumb li").filter("img[src$= .jpg ]").hover(function(){




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签