简体   繁体   English

警报,hasClass和其他不起作用pikachoose滑块

[英]The alert, hasClass and other doesn't work pikachoose slider

Here is my website: http://www.proservinformatika.hu/!orex/ 这是我的网站: http : //www.proservinformatika.hu/!orex/

I exactly added the "pikachoose" gallery slider plugin (it's free - http://www.pikachoose.com ), and it works so fine! 我究竟添加了“pikachoose”画廊滑块插件(它是免费的- http://www.pikachoose.com ),它的工作这么好! You can see the thumbnails under the full image. 您可以在完整图像下看到缩略图。 I finally solved to make captions at the center of the thumbs. 我终于解决了,将字幕放在拇指的中心。

And you can see the <li class="active capik-no"> thumb active status, and you can see the slider continuously changing the images after a few seconds.. When the slider changes to another image, the first current <li class="active capik-no"> changing to simple <li> and the second <li> changing to <li class="active capik-no"> . 并且您可以看到<li class="active capik-no">拇指处于活动状态,并且可以看到滑块在几秒钟后不断更改图像。.当滑块更改为另一图像时,第一个当前<li class="active capik-no">更改为简单的<li> ,第二个<li>更改为<li class="active capik-no"> Yea this is an automatic slider everlasting process.. 是的,这是一个持久的自动滑块过程。

My problem is: I'm tried to do the alert() fn. 我的问题是:我试图做alert() fn。 like this: 像这样:

        if ($('.pikachoose li').hasClass("active")) {
           alert('test');
        }

or 要么

        if ($('.pikachoose li').hasClass("capik-no")) {
           alert('test');
        }

The capik-no is just a test class. capik-no仅仅是测试课程。 With a "display: none;" 带有"display: none;" css code. CSS代码。 The capik is just a test class. capik只是测试课程。 With a "display: block; position: absolute;" 带有"display: block; position: absolute;" css code. CSS代码。

The alert and console.log doesn't work... and you can see in the code <span class="capik">Text 1</span> "capik" class is the thumbnail caption... 警报和console.log不起作用...,您可以在代码<span class="capik">Text 1</span> “ capik”类中看到缩略图标题...

My plan is: Trying to change the thumb's active status to this: Active thumb status don't have caption.. Only the passive status thumbs have. 我的计划是:尝试将拇指的活动状态更改为:活动拇指状态没有标题。只有被动状态拇指具有字幕。 And I'd like to solve this with hasClass, addClass, removeClass variety of solutions. 我想用hasClass, addClass, removeClass各种解决方案来解决这个问题。

BUT.... The alert and others doesn't work... I guess JQuery generates the active and capik-no classes... 但是...。警报和其他警报不起作用... 我猜JQuery会生成active类和capik-no类...

So especially the system can't find this <li> classes because of generated by JQuery??? 因此,特别是由于JQuery生成的系统找不到此<li>类??? The alert can't run.. the console.log can't run with these classes..... 警报无法运行.. console.log不能与这些类一起运行.....

So the hasClass and others can't run too... And I can't solve to make the active thumb status to hide the caption with capika-no class.... 所以hasClass和其他人不能太跑......我解决不了,从而使活性拇指状态,隐藏的文字说明capika-no级....

Here is the js: http://www.proservinformatika.hu/!orex/js/jquery.pikachoose.js 这是js: http : //www.proservinformatika.hu/! orex/js/ jquery.pikachoose.js

Please check the either thumb image element (Ctrl-Shift-i). 请检查任一拇指图像元素(Ctrl-Shift-i)。 Here is the simple code: 这是简单的代码:

<div class="pikachoose">
    <ul class="jcarousel-skin-pika pika-thumbs">
        <li class="active capik-no">
            <div class="clip">
                <img ref="http://www.proservinformatika.hu/!orex//images/slider-main/big/1.jpg" src="http://www.proservinformatika.hu/!orex//images/slider-main/small/1.jpg" class="" style="display: inline; width: 100%; opacity: 0.4;">
                <span class="capik">Text 1</span>
            </div>
        </li>
        <li>
            <div class="clip">
                <img ref="http://www.proservinformatika.hu/!orex//images/slider-main/big/2.jpg" src="http://www.proservinformatika.hu/!orex//images/slider-main/small/2.jpg" class="" style="display: inline; width: 100%; opacity: 0.4;">
                <span class="capik">Text 2</span>
            </div>
        </li>
        <li>
            <div class="clip">
                <img ref="http://www.proservinformatika.hu/!orex//images/slider-main/big/3.jpg" src="http://www.proservinformatika.hu/!orex//images/slider-main/small/3.jpg" class="" style="display: inline; width: 100%; opacity: 0.451875827717631;">
                <span class="capik">Text 3</span>
            </div>
        </li>
        <li>
            <div class="clip">
                <img ref="http://www.proservinformatika.hu/!orex//images/slider-main/big/4.jpg" src="http://www.proservinformatika.hu/!orex//images/slider-main/small/4.jpg" class="active capik-no" style="display: inline; width: 100%; opacity: 1;">
                <span class="capik">Text 4</span>
            </div>
        </li>
    </ul>
</div>

My current code to solve the problem is (but doesn't work...=/ ): 我当前解决该问题的代码是(但不起作用... = /):

if($('.pikachoose li').hasClass('active')) {
    $('.pikachoose li span').addClass('capik-no');
    $('.pikachoose li span').removeClass('capik');
} else {
    $('.pikachoose li span').addClass('capik');
    $('.pikachoose li span').removeClass('capik-no');
}

Please heelp!!:/ I want to hide the caption from the activated status of the thumb!!:( :/我想隐藏字幕的激活状态!! :(

I want to hide the caption from the activated status of the thumb 我想从拇指的激活状态隐藏字幕

I think all you need here is a bit of CSS to hide the caption <span class="capik"> when the li has the class active 我想您需要的是一点点CSS,以便在li active类时隐藏标题<span class="capik">

.pika-thumbs .active .capik { display: none; }

Hide caption when the thumb is hovered on: 拇指悬停时隐藏字幕:

.pika-thumbs li:hover .capik { display: none; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM