最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Max with of Colorbox window? - Stack Overflow

programmeradmin2浏览0评论

I am using an iFrame Colorbox (/) and I need to make it "responsive". Right now I have set the width to 90% and it works but after a certain size I do not want it to expand anymore, regardless of screen size. I want to set the max width to 1200px.

How can I do this?

I am using an iFrame Colorbox (http://jacklmoore./colorbox/) and I need to make it "responsive". Right now I have set the width to 90% and it works but after a certain size I do not want it to expand anymore, regardless of screen size. I want to set the max width to 1200px.

How can I do this?

Share Improve this question asked Mar 7, 2012 at 11:42 Jonathan ClarkJonathan Clark 20.6k29 gold badges116 silver badges177 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

Have you tried the maxWidth property? You use it in conjunction with the width property in order to set a max size. Example: $('a.example').colorbox({width:'90%', maxWidth:1200});

I just did something like this... below is for iPhone/Android. Needs some tweaking depending on content but it's a start for ya'll.

@media screen and (max-width: 480px), (-webkit-min-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min--moz-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5) {
#colorbox, #cboxWrapper, #cboxContent { width:320px !important; }
}
发布评论

评论列表(0)

  1. 暂无评论