We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    http://jsfiddle.net/fourroses666/Lc7p10wv/

    As you can see in the jsfiddle the < strong > text is hidden on the first text line!

    How can I change this the easiest way by just do a change with the js?
    I don't want to re-invent the wheel on this one, just trying to ignore / not hide the < strong >

    I don't see why it happens. is it the .next().hide() ?

        $(function() {
            $("#sliderContent img").next().hide().append('<input value="Show less" type="button" class="btn" />');
            
            $("#sliderContent img").click(function() {
                $(this).next().slideToggle();
            });
            
            $("input.btn").click(function() {
                $(this).parent().slideUp();
            });
        });
    


    Any help is appreciated

    This question has been answered by multiple community members. See the first response.

      Evolution user, I like the back-end speed and simplicity smiley
    • discuss.answer
      • 13428 ☆ A M B ☆
      • 1,031 Posts
      $("#sliderContent img") selects all images in the slider. You have to change the selector to something that selects only the .btn-down image.
      • discuss.answer
        • 9995
        • 1,613 Posts
        Weird, it looks like this works, thanks:

            $(function() {
                $("#sliderContent img.btn-down").next().hide().append('<input value="Show less" type="button" class="btn" />');
                
                $("#sliderContent img.btn-down").click(function() {
                    $(this).next().slideToggle();
                });
                
                $("input.btn").click(function() {
                    $(this).parent().slideUp();
                });
            });


        http://jsfiddle.net/fourroses666/Lc7p10wv/1/
          Evolution user, I like the back-end speed and simplicity smiley