Override jQuery style value

To solve the jQuery slideDown / Up problem, I had to change one line in the jQuery file.

I changed line 5738 from this.elem.style.display = "block"; at this.elem.style.display = "inline-block";

The block attribute ruined my lists when using slideDown / Up / Toggle. slideDown changes my list from display: inline to display: block at runtime, and then back to display: inline again. It would be much better if it were an inline (or inline block) all the way. Is there a way to override the value above on my html page, or do I need to stick with my modified jQuery file?

It would be nice if I could override the style attribute only when I execute $ ('. Gallery_container li: gt (4)'). slideToggle ();

Here's the code: http://90.230.237.71/gandhi.html

+4
source share
1 answer
$('#as_test').slideUp(300,function(){ $('#your_lists_id').css('display','inline'); //$('#your_lists_id').css('display','inline-block'); }); 

There is a callback function for slideUp and slideDown, it is called as soon as the slideUp or slideDown finishes its task, and therefore, you can easily give what you want to do as soon as you finish the slide action.

+2
source

Source: https://habr.com/ru/post/1312643/


All Articles