简体   繁体   中英

coin slider jquery --> how do I pass 100% width argument to this? Only seems to allow pixel configuration of images?

I am using the jQuery coinslider, and would like to pass a 100% width argument (rather than the current pixel size arguments). Is there a way to do this?

Thanks!

<script type="text/javascript">// <![CDATA[
(function($) { 
  $(document).ready(function() { 
    $('#coin-slider').coinslider({ effect: 'rain',width:680,height:275, delay:  5000,navigation: true, pause:200 }); 
  }); 
})(j142);
// ]]></script>
<div id="coin-slider"><a href="#" target="_blank"> <img src="img1.jpg" alt="" /> 
</a> <a href="#"> <img src="#" alt="" /> 

Rather than pass width 680, I want to pass width 100% (or anything so that it sizes for width of the browser. Does anyone know how to do this?

thanks much in advance!!

您可以这样做:

$('#coin-slider').coinslider({ effect: 'rain',width:$('#coin-slider').parent().width(),height:275, delay:  5000,navigation: true, pause:200 }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM