I can't make it so that when I click on a block, the color of its edges changes to a different color using .animate() , nothing comes out! (2 line from this script), please help!

 if ($(".title_text_variant").text() == "Click to open...") { $(".main_block_variant").animate({'borderColor': '#5dbf76'}, 500); $(".title_text_variant").text("Click to close..."); return $(".block_variant").slideDown(500); } 
  • one
    You have an error. The return is only for functions in the if block that does not work, and there will be an error - Alexander Zaytsev
  • function actionvariant () {if ($ (". title_text_variant"). text () == "Click to open ...") {$ (". main_block_variant"). css ("border", "2px solid # 5dbf76" ) .slideDown (1000); $ (". title_text_variant"). text ("Click to close ..."); return $ (". block_variant"). slideDown (500); } if ($ (". title_text_variant"). text () == "Click to close ...") {$ (". title_text_variant"). text ("Click to open ..."); return $ (". block_variant"). slideUp (500); }} I am writing this in a function, just sent a piece of code - Mark Minerov
  • one
    Nothing is clear in pieces, for example, what is your markup? I see three classes: title_text_variant , main_block_variant , block_variant . What how? - Alexander Zaytsev
  • I have already figured out, but thanks anyway, that you have responded! - Mark Minerov 4:05 pm

0