Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将箭头与滑块功能分开_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 将箭头与滑块功能分开

Javascript 将箭头与滑块功能分开,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我有一个滑块,它可以切换除法器,上面有两个箭头(上一个和下一个),现在我不关心箭头的外观或位置。但是我想让它们功能化,但是应用于滑块的其他功能,如悬停,也应用于箭头。如何保持按钮功能(下一个/上一个),但使其与滑块分离 JSFIDDLE: CSS: 您可以更具体地使用类的选择器仅针对div中的img元素。滑块视图区域 jQuery(function ($) { $('.slider-view-area img').hover(function () { // on mouseover

我有一个滑块,它可以切换除法器,上面有两个箭头(上一个和下一个),现在我不关心箭头的外观或位置。但是我想让它们功能化,但是应用于滑块的其他功能,如悬停,也应用于箭头。如何保持按钮功能(下一个/上一个),但使其与滑块分离

JSFIDDLE:

CSS:


您可以更具体地使用类
的选择器仅针对
div
中的
img
元素。滑块视图区域

jQuery(function ($) {
    $('.slider-view-area img').hover(function () { // on mouseover
        $('.slider-view-area img').stop().not(this).animate({
            'opacity': 0.4
        }, 700); // you can animate this as well
        $(this).animate({
            'opacity': 1
        }, 700);
    }, function () { // on mouseout
        $('#.slider-view-area img').animate({
            'opacity': 1
        }, 700);
    });
});

演示:

添加另一个
。不要在代码中过滤,请更改:

$('#first img').stop().not(this).animate({'opacity':0.4},700); // you can animate this as well


谢谢,我会在几分钟内批准答案(时间限制)
$('#first img').stop().not(this).animate({'opacity':0.4},700); // you can animate this as well
 $('#first img').stop().not(this).not('#prev, #next').animate({'opacity':0.4},700); // you can animate this as well