Javascript 使用JCarousel更改高度

Javascript 使用JCarousel更改高度,javascript,jquery,jcarousel,Javascript,Jquery,Jcarousel,我修改了灵活的示例。我改变了高度,但是图像被剪掉了。我不知道为什么会这样。有人能帮我吗 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us"> <head&

我修改了灵活的示例。我改变了高度,但是图像被剪掉了。我不知道为什么会这样。有人能帮我吗

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
<title>jCarousel Examples</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
<!--
  jQuery library
-->
<script type="text/javascript" src="../lib/jquery-1.4.2.min.js"></script>
<!--
  jCarousel library
-->
<script type="text/javascript" src="../lib/jquery.jcarousel.min.js"></script>
<!--
  jCarousel skin stylesheet
-->
<link rel="stylesheet" type="text/css" href="../skins/tango/skin.css" />

<style type="text/css">

/**
 * Overwrite for having a carousel with dynamic width.
 */
.jcarousel-skin-tango .jcarousel-container-horizontal {
    width: 85%;
}

.jcarousel-skin-tango .jcarousel-clip-horizontal {
    width: 100%;
    height:300px;

}

</style>

<script type="text/javascript">

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        visible: 4
    });
});

</script>

</head>
<body>
<div id="wrap">
  <h1>jCarousel</h1>
  <h2>Riding carousels with jQuery</h2>

  <h3>Flexible carousel</h3>
  <p>
    This example shows a carousel with flexible item width. In this case, always
      4 items are visible (resize the browser window to see what happens).
  </p>

  <ul id="mycarousel" class="jcarousel-skin-tango">
    <li><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/58/199481143_3c148d9dd3_s.jpg" width="175" height="375" /></li>
    <li><img src="http://static.flickr.com/72/199481203_ad4cdcf109_s.jpg" width="175" height="375" /></li>
    <li><img src="http://static.flickr.com/58/199481218_264ce20da0_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/69/199481255_fdfe885f87_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/60/199480111_87d4cb3e38_s.jpg" width="175" height="375" alt="" /></li>
    <li><img src="http://static.flickr.com/70/229228324_08223b70fa_s.jpg" width="175" height="375" alt="" /></li>
  </ul>

</div>
</body>
</html>

jCarousel示例
/**
*覆盖具有动态宽度的旋转木马。
*/
.jcarousel skin tango.jcarousel容器水平{
宽度:85%;
}
.jcarousel skin tango.jcarousel水平夹{
宽度:100%;
高度:300px;
}
jQuery(文档).ready(函数(){
jQuery(“#mycarousel”).jcarousel({
可见:4
});
});
jCarousel
带jQuery的旋转木马
柔性转盘

此示例显示具有灵活项目宽度的旋转木马。在这种情况下,始终
4项可见(调整浏览器窗口大小以查看发生的情况)。

发生的情况如下:


如您所见,图像被切断。

将您的LI设置为所需的高度和宽度。jcoursel将需要此选项,否则它将无法正确循环

#mycarousel li { height: 375px; width: 175px;}

将LI设置为所需的高度和宽度。jcoursel将需要此选项,否则它将无法正确循环

#mycarousel li { height: 375px; width: 175px;}