Jump to content
php.lv forumi

jquery remove add class loop


ziedinjsh

Recommended Posts

Sveiki! Es te cīnos, bet īsti nesanāk panākt vēlamo. Nospiežot pogu kas sumbito formu caur jquery/ajax pie response notiek darbība.Šinī gadījumā: ja div (.message) nav redzams un parādās ar css animāciju, bet ja ir redzams notiek cita animācija, bet brīdī kad viņš ir parādījies un pēc otrās animācijas (otro reizi nospiežot submit pogu) vairs nevar panāk lai viņš rāda animāciju atkārtoti!

JS:

if(response){
					if($('.message').is(':visible')){
						$('.message').removeClass('tada').addClass('shake');
						$('message').toggleClass('shake');
					}else{
						$('.message').addClass('tada').html(response).show();
					}
				}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...