Link to home
Start Free TrialLog in
Avatar of MOSTAGHASSI
MOSTAGHASSIFlag for United States of America

asked on

Carousel codes correction

I have used 'autoplay' carousel from site:

http://kenwheeler.github.io/slick/

and i want that set width of place that shows the slides,please let me know that how can set it?

thanks
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Can you describe what you want to do in more detail?  Screenshots with annotations work well...
Avatar of MOSTAGHASSI

ASKER

Yes,in each kind of carousel that you select(i have selected autoplay) there is a place that slides move inside it and it is around 500px ,but i want that change this to e.g 1000px and i cannot.
What are you doing to set the width?
Because my codes retrieve the data from mysql and i have these codes then i must say that i use 'table' instead of 'div'  for changing the width i change the width of table as below:

      <table width="950" height="90" border="0" align="center" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF" class="autoplay" style=" border:1px solid #ffffff">
        <tr class="autoplay">
         <td >//my codes</td>
         </tr>
          </table/

Open in new window


so it works good but  width="950" does not work and the place of slider remain Constance around 500.
Why would you use a table?  Use a div element with proper CSS targeting.
Ok,suppose we use div how can apply our css to these codes:

		<div class="slider autoplay">
					<div><h3>1</h3></div>
					<div><h3>2</h3></div>
					<div><h3>3</h3></div>
					<div><h3>4</h3></div>
					<div><h3>5</h3></div>
					<div><h3>6</h3></div>
				</div>
			<pre><code class="language-javascript">
$('.autoplay').slick({
  slidesToShow: 3,
  slidesToScroll: 1,
  autoplay: true,
  autoplaySpeed: 2000,
});
				</code></pre>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks,but why it does not work for table?
Because tables work differently.  You can provide a table with a width and height, but it will resize in an attempt to make its content fit.  

Generally speaking, use tables only for tabular data, such as statistics or spreadsheet displays.  Do not use it as a base structural element.
Thanks Steve, i changed it to div and it works very well.