2016-09-19 51 views
0

我正在尝试使用CSS制作翻转操作,它在浏览器中看起来不错,但在手机上无法正常工作。任何人都可以通过CSS来做到这一点,但如果我需要JavaScript,我愿意考虑。我意识到我在下面使用的CSS有点多,但我已经建立了风格,但必须忽略如何处理手机。使用CSS的小到大图像,适用于手机

.ienlarger { 
 
    \t float: left; 
 
    \t clear: none; 
 
    \t padding-bottom: 5px; 
 
    \t padding-right: 5px; 
 
    } 
 
    .ienlarger a { 
 
    \t display:block; 
 
    \t text-decoration: none; 
 
    } 
 
    .ienlarger a:hover{ position:relative; 
 
    } 
 
    .ienlarger span img { 
 
    \t border: 1px solid #FFFFFF; 
 
    \t margin-bottom: 8px; 
 
    } 
 
    .ienlarger a span {position: absolute;display:none;color: #FFCC00;text-decoration: none;font-family: Arial, Helvetica, sans-serif;font-size: 13px;font-weight: bold;padding:5px;border:3px solid #289fd9;box-shadow: 0px 0px 5px #2382b1;background-color:#fff; 
 
    } 
 
    .ienlarger img {border-width: 0;} 
 
    .ienlarger a:hover span { 
 
    \t display:block; 
 
    \t top: 50px; 
 
    \t left: 90px; 
 
    \t z-index: 100;width:300px; 
 
    } 
 
    .resize_thumb { 
 
    \t width: 150px; 
 
    \t height : auto; 
 
    }
<table> 
 
      <tbody>   
 
       <tr bgcolor="#289fd9"> 
 
       <td width="25%">The Image</td> 
 
       <td width="75%"><strong>Verbiage</strong></td> 
 
       </tr> 
 
       <tr> 
 
       <td style="background-color: rgb(255, 255, 255);vertical-align:middle;" class="ienlarger"><a href="#"><img src="http://fiftyshadesofkevin.com/images/small.jpg" width="50%" class="resize_thumb" /><span> 
 
        <img src="http://fiftyshadesofkevin.com/images/large.jpg" alt="large" /></span></a></td> 
 
    \t \t \t <td>Here is something that would describe the image</td> 
 
       </tr> 
 
      </tbody> 
 
</table>

下面是示例页面 http://fiftyshadesofkevin.com/hover.html

的想法和概念任何人将不胜感激。

+0

究竟是行不通的,它似乎在我的Android设备的罚款。 –

回答

0

我能够做到以下,使其工作:

.ienlarger { 
    float: left; 
    clear: none; /* set to left or right if needed */ 
    padding-bottom: 5px; /* space between thumbs. Don't change this to margin */ 
    padding-right: 5px; /* space between thumbs and wrapping text when there is any text around it */ 
} 

.ienlarger a { 
    display:block; 
    text-decoration: none; 
/* add cursor:default; to this rule to disable the hand cursor */ 
} 

.ienlarger a:hover{ /* don't move this positioning to normal state */ 
    position:relative; 
} 

.ienlarger span img { 
    border: 1px solid #FFFFFF; /* adds a border around the image */ 
    margin-bottom: 8px; /* pushes the text down from the image */ 
} 

.ienlarger a span { /* this is for the large image and the caption */ 
    position: absolute; 
    display:none; 
    color: #FFCC00; /* caption text colour */ 
    text-decoration: none; 
    font-family: Arial, Helvetica, sans-serif; 
    font-size: 13px; /* caption text size */ 
    font-weight: bold; 
    padding:5px;border:3px solid #289fd9;box-shadow: 0px 0px 5px #2382b1;background-color:#fff; 
} 

.ienlarger img { /* leave or IE puts a border around links */ 
border-width: 0; 
} 

.ienlarger a:hover span { 
    display:block; 
    top: 50px; /* means the pop-up's top is 50px away from thumb's top */ 
    left: 90px; /* means the pop-up's left is 90px far from the thumb's left */ 
    z-index: 100;width:300px; 

/* If you want the pop-up open to the left of thumb, remove the left: 90px; and add 
right: 90px; This would mean the right side of the pop-up is 90px far from the right side of thumb */ 

/* If you want the pop-up open above the thumb, remove the top: 50px; and add 
bottom: 50px; This would mean the bottom of the pop-up is 50px far from the bottom of thumb */ 

/* add cursor:default; to this rule to disable the hand cursor only for the large image */ 
} 

.resize_thumb { 
    width: 150px; /* enter desired thumb width here */ 
    height : auto; 
}