[英]Jquery Content DIV SLIDE
I wanted to make the 我想做
(A) http://jqueryui.com/demos/slider/#side-scroll (A) http://jqueryui.com/demos/slider/#side-scroll
(B) http://jqueryui.com/demos/slider/steps.html (B) http://jqueryui.com/demos/slider/steps.html
Hey all, 大家好,
I am building a customize slider. 我正在构建一个自定义滑块。
I wanted the functionality of A and B mixed both 我想要A和B的功能混合在一起
1) Boxes in A is going to be in different Tag/Category, so for example there's going to be Cat, Dog and Snake category. 1)A中的框将具有不同的标签/类别,因此例如将有Cat,Dog和Snake类别。
2) Now i wanted when i do click on CAT the slider is going to slide that particular cartigory thats associated with the Tag, etc 2)现在我想当我点击CAT时,滑块将滑动与Tag相关的特定的制图法,等等
3) If i do slide to CAT tag, it will just snap and the catagory will show up 3)如果我确实滑到CAT标签,它会卡住并且类别会显示
help will be good, as i continue try figuring it out, hope im not confusing you guys. 帮助会很好,因为我会继续尝试解决问题,希望我不要让你们感到困惑。 or 要么
OR THIS: 或这个:
http://jqueryui.com/demos/slider/#hotelrooms and http://jqueryui.com/demos/slider/#side-scroll http://jqueryui.com/demos/slider/#hotelrooms和http://jqueryui.com/demos/slider/#side-scroll
instead when u click 3, it slides to 3CONTENT when u lick 4 it SLIDES to 4 CONTENT 相反,当您单击3时,它会滑动到3CONTENT;当您单击4时,它会滑到4 CONTENT
Do you mean something like this? 你的意思是这样吗? I have taken your reference (A) as an example. 我以您的参考文献(A)为例。
$(".scroll-content div").click(function () {
var pos = $(this).position();
$('.scroll-bar a').animate({ left: pos.left }, 'slow');
});
Check in action here . 在此处检查操作。
Update1: I updated the sample in above link, if that helps. Update1:如果有帮助,我在上面的链接中更新了示例。
Update 2: 更新2:
Sorry, I tried a bit but couldn't make it work entirely but here is something I have: 抱歉,我尝试了一下,但无法使其完全正常工作,但是我有一些东西:
$(function(){
$("div#makeMeScrollable").smoothDivScroll();
var ticker;
$('.scrollingHotSpotRight').mouseover(function () {
var counter = $(".scroll-bar").slider("value");
var leftval = 0;
ticker = setInterval(function () {
$(".scroll-bar").slider("value", counter);
counter++;
}, 35);
});
$('.scrollingHotSpotRight').mouseout(clearStop);
$('.scrollingHotSpotLeft').mouseover(function () {
var counter = $(".scroll-bar").slider("value");
ticker = setInterval(function () {
$(".scroll-bar").slider("value", counter);
counter--;
}, 35);
});
$('.scrollingHotSpotLeft').mouseout(clearStop);
function clearStop() {
window.clearInterval(ticker);
}
});
All you need to do is utilize the step option in the scrollbar implementation, if I understand your question correctly. 如果我正确理解了您的问题,那么您所要做的就是利用滚动条实现中的step选项。
//Modified from the Slider scrollbar demo
var scrollbar = $( ".scroll-bar" ).slider({
slide: function( event, ui ) {
if ( scrollContent.width() > scrollPane.width() ) {
scrollContent.css( "margin-left", Math.round(
ui.value / 100 * ( scrollPane.width() - scrollContent.width() )
) + "px" );
} else {
scrollContent.css( "margin-left", 0 );
}
},
step: 50 //<---This
});
Or are you looking for someone to write the entire functionality of what you're asking for? 还是您正在寻找可以编写您所要求的全部功能的人?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.