jQuery cycle slideshow resize problem

守給你的承諾、 提交于 2019-12-05 20:06:27

I've never used jquery.cycle before, but its adjusting your width based on the initial browser width when it renders. Upon resizing the browser, these widths are not being adjusted either, which is causing your ultimate problem.

Viewing your CSS, it appears you're trying to set a width of 100% directly to these divs (which is not taking affect since jquery.cycle is applying a width directly to the element overriding it). An immediate solution is specifying !important immediately following your widths on the div elements in your CSS (enforcing that the elements use your CSS directly).

For example (lets take the first blue div):

.fadein {
   width: 100% !important
}

.hd_splash_container_blue {
   width: 100% !important
   poisition: relative;
}

.main_blue {
   margin-left:70px;
   margin-right:70px;
   position: relative;
} 

This should allow you to re-size the browser successfully keeping the contents centered as desired.

I might suggest applying your CSS at a higher level, since the only changes between each high level is the image (which can be done as it is now). Take the rest of the CSS out and apply it at a high level:

.hd_splash_container {
   width: 100% !important
   poisition: relative;
}

.main_color {
   margin-left:70px;
   margin-right:70px;
   position: relative;
} 

I believe the very same affect can actually be achieved using the native options of the Cycle plugin. Try adding these rules like so:

$('#slides').cycle({ 
  resizeContainer: false,
  slideResize: false
});     
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!