jQuery('h2.product-name a').each(function() {
         var str = jQuery(this).html();
         var n = 2; // second space
         var a = str.split(' ')
         var first = a.slice(0, n).join(' ')
         var second = a.slice(n).join(' ');
         jQuery(this).html('<span class="first-word">' + first + '</span><br><span class="first-word">' + second + '</span>' );
        });


above do set enter after 2 words automatically



jQuery(this).html('<span class="first-word">' + word.substring(0, index) + '</span>' + word.substring(index, word.length));

and this can change first word of css



 owl-slider

   
    ClickTogoSlide('.btn1', '1');
    ClickJumpToSlide('.btn2', '1');
   
    function ClickTogoSlide(ButtonIdClass, GoThisSlide) {
        $(ButtonIdClass).click(function(){
            $('#owl-demo').trigger('owl.goTo', GoThisSlide);       
        });
    }
    function ClickJumpToSlide(ButtonIdClass1, GoThisSlide1) {
        $(ButtonIdClass1).click(function(){
            $('#owl-demo').trigger('owl.jumpTo', GoThisSlide1);       
        });
    }

Comments