2016-05-30 46 views
0

我使用滑动滑块。我想在iMac PNG图片中制作一个滑块。不能做正确的方式来响应它,并使其在该png图片内滚动。请帮助解决该问题。这是我的exampleiMac内部灵敏的滑动滑块

jQuery(document).ready(function(){ 
    jQuery(".mac-slider").slick({ 
    centerMode: true, 
    centerPadding: '60px' 
    }); 
}); 
+0

你真的觉得有什么特别的滑块“内iMac”?使用什么浏览器更重要,而不是您拥有哪种类型的计算机硬件。 –

+0

@low_rents我的意思是在一张iMac图片中)) – pwnz22

回答

0

您可以设置图片的静态宽度和高度以适应屏幕的iMac和位置使用position: relative

html, body{ 
    height: 100%; /* Body and html need to have 100% height in order to show whole background image */ 
} 

.mac-slider { 
    background-image: url('http://www.cincinnatiskinandlaser.com/wp-content/plugins/wp-graphic/templates/video/imac/images/testi_bg.png'); 
    background-position: top center; 
    background-repeat: no-repeat; 
    height: 100%; /* This also needs to have 100% height in order to show whole background image */ 
} 

.mac-slider-item img { 
    margin: 27px auto; 
    opacity: 0.3; 
} 

.slick-current img { 
    opacity: 1 !important; 
    position: relative; /* Position of current image centered in iMac screen */ 
    left: 2px; 
    top: -9px; 
} 

.slick-slide img{ 
    width: 467px; /* Static dimensions of picture to fit into iMac screen */ 
    height: 263px; 
} 
+0

主要问题是幻灯片必须在显示器下滚动。 – pwnz22