admin管理员组文章数量:1026687
So i have this site: /. I have my portfolio images in a grid like formation using the <li>
tag on the front page. I need them to align side by side and scroll horizontally automatically, maybe using javascript or jquery (no other libraries, please). It's fine if it has a scrollbar as well. I've tried something like this:
.portfolio li {
width: 438px !important;
display:inline !important;
}
and then
<ul id="thumbs" style="width:100%;list-style:none;display:block;white-space:nowrap;">
<li class="portfolio" style="width: 438px; opacity: 1;display:inline;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
that's basically just a stripped down version if you vist the page theres a lot more tags associated. but even this code alone (with all the tags closed obviously) didn't seem to work..
So i have this site: http://onthemouse./. I have my portfolio images in a grid like formation using the <li>
tag on the front page. I need them to align side by side and scroll horizontally automatically, maybe using javascript or jquery (no other libraries, please). It's fine if it has a scrollbar as well. I've tried something like this:
.portfolio li {
width: 438px !important;
display:inline !important;
}
and then
<ul id="thumbs" style="width:100%;list-style:none;display:block;white-space:nowrap;">
<li class="portfolio" style="width: 438px; opacity: 1;display:inline;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
that's basically just a stripped down version if you vist the page theres a lot more tags associated. but even this code alone (with all the tags closed obviously) didn't seem to work..
Share Improve this question edited Jul 28, 2012 at 7:00 gherkins 15k7 gold badges46 silver badges74 bronze badges asked Jul 28, 2012 at 6:57 Atom VayalinkalAtom Vayalinkal 2,7028 gold badges30 silver badges37 bronze badges 3- What do you need? Your images already are placed side by side – d.k Commented Jul 28, 2012 at 7:21
- i need them to scroll horizontally, without going on to the next line, so that i have a ton of space left on the bottom. – Atom Vayalinkal Commented Jul 28, 2012 at 7:25
- Actually, what you want is not a responsive design – d.k Commented Jul 28, 2012 at 7:28
2 Answers
Reset to default 1You could consider using Flexislider for your problem here. It's a responsive slider.
http://www.woothemes./flexslider/
remove display:inline
, width
from style
attr of your li
<ul id="thumbs" style="list-style:none;">
<li class="portfolio" style="opacity: 1;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
#works, #wrapper {
overflow: visible;
}
body {
overflow-x:auto;
}
#thumbs .portfolio {
display:inline-block;
width: 438px !important;
float:none !important;
}
#thumbs {
white-space:nowrap;
}
/* for ie 7*/
*:first-child+html #thumbs .thumb {
display:inline;
zoom:1;
}
/* for ie 6*/
*html #thumbs .thumb {
display:inline;
zoom:1;
}
So i have this site: /. I have my portfolio images in a grid like formation using the <li>
tag on the front page. I need them to align side by side and scroll horizontally automatically, maybe using javascript or jquery (no other libraries, please). It's fine if it has a scrollbar as well. I've tried something like this:
.portfolio li {
width: 438px !important;
display:inline !important;
}
and then
<ul id="thumbs" style="width:100%;list-style:none;display:block;white-space:nowrap;">
<li class="portfolio" style="width: 438px; opacity: 1;display:inline;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
that's basically just a stripped down version if you vist the page theres a lot more tags associated. but even this code alone (with all the tags closed obviously) didn't seem to work..
So i have this site: http://onthemouse./. I have my portfolio images in a grid like formation using the <li>
tag on the front page. I need them to align side by side and scroll horizontally automatically, maybe using javascript or jquery (no other libraries, please). It's fine if it has a scrollbar as well. I've tried something like this:
.portfolio li {
width: 438px !important;
display:inline !important;
}
and then
<ul id="thumbs" style="width:100%;list-style:none;display:block;white-space:nowrap;">
<li class="portfolio" style="width: 438px; opacity: 1;display:inline;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
that's basically just a stripped down version if you vist the page theres a lot more tags associated. but even this code alone (with all the tags closed obviously) didn't seem to work..
Share Improve this question edited Jul 28, 2012 at 7:00 gherkins 15k7 gold badges46 silver badges74 bronze badges asked Jul 28, 2012 at 6:57 Atom VayalinkalAtom Vayalinkal 2,7028 gold badges30 silver badges37 bronze badges 3- What do you need? Your images already are placed side by side – d.k Commented Jul 28, 2012 at 7:21
- i need them to scroll horizontally, without going on to the next line, so that i have a ton of space left on the bottom. – Atom Vayalinkal Commented Jul 28, 2012 at 7:25
- Actually, what you want is not a responsive design – d.k Commented Jul 28, 2012 at 7:28
2 Answers
Reset to default 1You could consider using Flexislider for your problem here. It's a responsive slider.
http://www.woothemes./flexslider/
remove display:inline
, width
from style
attr of your li
<ul id="thumbs" style="list-style:none;">
<li class="portfolio" style="opacity: 1;">
<a href="BLAHBLAH" title="BLAHBLAH">
<img src="BLAHBLAH" alt="" title="" >
</a>
</li>
#works, #wrapper {
overflow: visible;
}
body {
overflow-x:auto;
}
#thumbs .portfolio {
display:inline-block;
width: 438px !important;
float:none !important;
}
#thumbs {
white-space:nowrap;
}
/* for ie 7*/
*:first-child+html #thumbs .thumb {
display:inline;
zoom:1;
}
/* for ie 6*/
*html #thumbs .thumb {
display:inline;
zoom:1;
}
本文标签: javascriptHow to autoscroll images horizontally in responsive designStack Overflow
版权声明:本文标题:javascript - How to auto-scroll images horizontally in responsive design - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745648178a2161150.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论