gpt4 book ai didi

Jquery slider handle 不移动

转载 作者:行者123 更新时间:2023-12-01 05:57:27 25 4
gpt4 key购买 nike

我正在将我们的 drupal 6 网站升级到 drupal 7,并随之而来的是更新版本的 Jquery。我有一个 slider 画廊,其中包含一些盒子截图,您可以水平浏览它们,在新网站上,您仍然可以滚动浏览内容,但 handle 不会移动。

知道为什么 slider 仍然可以工作但 handle 本身不再工作了吗?

我尝试了 JqueryUi.com 处的 slider 也一样,但是 slider 甚至不显示......

初始版本基于this slidergallery但由于 Jquery 更新,那个不能再使用了。

CSS:

     /* slider specific CSS */
body.page-node-483 .sliderGallery {
background: url(/sites/all/themes/fourpees2011/css/images/productbrowser-background3.png) no-repeat;
overflow: hidden;
position: relative;
padding: 10px;
height: 200px;
width: 960px;
}

body.page-node-483 .sliderGallery ul {
position: absolute;
list-style: none;
overflow: none;
white-space: nowrap;
padding: 0;
margin: 0;
}

body.page-node-483 .sliderGallery ul li {
display: inline;
margin-right: 30px;
}

body.page-node-483 .sliderGallery ul li.first {
margin-left: 20px;
}

body.page-node-483 .slider {
width: 950px;
height: 19px;
margin-top: 160px;
margin-left: 5px;
padding: 1px;
position: relative;
background: url(/sites/all/themes/fourpees2011/css/images/productbrowser-scrollbar2.png) no-repeat;
}

body.page-node-483 .handle {
position: absolute;
cursor: move;
height: 19px;
width: 187px;
top: 0;
background: url(/sites/all/themes/fourpees2011/css/images/productbrowser-scroller2.png) no-repeat;
z-index: 100;
}

body.page-node-483 .slider span {
color: #bbb;
font-size: 80%;
cursor: pointer;
position: absolute;
z-index: 110;
top: 3px;
}

脚本:

<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>

<script type="text/javascript" charset="utf-8">
window.onload = function () {
var container = $('div.sliderGallery');
var ul = $('ul', container);

var itemsWidth = ul.innerWidth() - container.outerWidth();

$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1}, 500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
};
</script>

和 HTML:

<div class="sliderGallery">
<ul>
<li><a href="/products/atomyx/atomyx-portal"<li><img src="/sites/default/files/products/boxshots/small/boxshot_Atomyx-Portal_LEFT_LR.png"></li></a>
<li><a href="/products/axaio-software/madetoprint"<li><img src="/sites/default/files/products/boxshots/small/MadeToPrint_0.png"></li></a>
<li><a href="/products/axaio-software/madetocompare"<li><img src="/sites/default/files/products/boxshots/small/MadeToCompare_0.png"></li></a>
<li><a href="/products/axaio-software/madeforlayers"<li><img src="/sites/default/files/products/boxshots/small/MadeForLayers.png"></li></a>
<li><a href="/products/callas-software/pdftoolbox"<li><img src="/sites/default/files/products/boxshots/small/pdfToolbox_0.png"></li></a>
<li><a href="/products/callas-software/pdftoolbox-server"<li><img src="/sites/default/files/products/boxshots/small/pdfToolboxServer_0.png"></li></a>
<li><a href="/products/callas-software/pdfapilot"<li><img src="/sites/default/files/products/boxshots/small/pdfaPilot_0.png"></li></a>
<li><a href="/products/callas-software/pdfapilot-server"<li><img src="/sites/default/files/products/boxshots/small/pdfaPilotServer_0.png"></li></a>
<li><a href="/products/ctrlpublishing/ctrlchanges"<li><img src="/sites/default/files/products/boxshots/small/CtrlChanges.png"></li></a>
<li><a href="/products/ctrlpublishing/ctrllayers"<li><img src="/sites/default/files/products/boxshots/small/CtrlLayers.png"></li></a>
<li><a href="/products/ctrlpublishing/ctrlcrosstalkid"<li><img src="/sites/default/files/products/boxshots/small/CtrlCrossTalkID.png"></li></a>
<li><a href="/products/ctrlpublishing/ctrlcrosstalk"<li><img src="/sites/default/files/products/boxshots/small/CtrlCrossTalk.png"></li></a>
<li><a href="/products/elpical/claro-premedia"<li><img src="/sites/default/files/products/boxshots/small/ClaroPremedia.png"></li></a>
<li><a href="/products/elpical/claro-single"<li><img src="/sites/default/files/products/boxshots/small/ClaroSingle.png"></li></a>
<li><a href="/products/printfactory/printfactory"<li><img src="/sites/default/files/products/boxshots/small/PrintFactory_0.png"></li></a>
<li><a href="/products/printfactory/printfactory-go"<li><img src="/sites/default/files/products/boxshots/small/PrintFactory_Go_Boxshot_0.png"></li></a>
<li><a href="/products/proofmaster/proofmaster-plus"<li><img src="/sites/default/files/products/boxshots/small/ProofMasterPlus.png"></li></a>
<li><a href="/products/proofmaster/proofmaster-certify"<li><img src="/sites/default/files/products/boxshots/small/ProofMasterCertify.png"></li></a>
<li><a href="/products/proofmaster/proofmaster-media"<li><img src="/sites/default/files/products/boxshots/small/ProofMasterMedia.png"></li></a>
<li><a href="/products/remote-director/remote-director"<li><img src="/sites/default/files/products/boxshots/small/Remote-director.png"></li></a>
<li><a href="/products/remote-director/press-director"<li><img src="/sites/default/files/products/boxshots/small/Press-director.png"></li></a>
<li><a href="/products/twixl-media/twixl-publisher"<li><img src="/sites/default/files/products/boxshots/small/Twixl-boxshot.png"></li></a>
<li><a href="/products/twixl-media/twixl-publisher-enterprise-kiosk"<li><img src="/sites/default/files/products/boxshots/small/Twixl-Enterprise-Kiosk-boxshot.png"></li></a>
</ul>
<div class="slider">
<div class="handle"></div>
</div>
</div>

全部内容都在 JSfiddle 上:http://jsfiddle.net/vTr5c/2/

最佳答案

从 jquery-1.7.1.min.js 迁移到 jquery-1.9.1.min.jss 时,我遇到了类似的“ slider handle 不移动”问题。在我这边,经过测试,这肯定是由于此文件更改造成的。 Jquery 中的某些语法可能从 1.7.1 更改为 1.9.1。我无法让您的代码/ slider 出现在 JSfiddle 上。 jsfiddle.net/vTr5c/2/

关于Jquery slider handle 不移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14042814/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com