Hello! Please tell me what is wrong in my expression.

<script type="text/javascript"> $('#container_logo p').hover( function(){ $($this).animate( { text-shadow: "#363535 3px 3px 3px" }, 5000); }, function(){ $($this).animate( { text-shadow: "#363535 1px 1px 1px" }, 5000); }); </script> 

Here is an example.

I want the cursor to change when I hover over the text.

  • one
    $ this - this is not pkhp - ReinRaus
  • @ReinRaus - this is already taken apart, there is an example. - Artyomich
  • one
    So many mistakes I haven’t seen yet O_o - k0mar
  • @IamS - you could not even comment, I'm not ready here, beautiful, the working code came to show! - Artyomich
  • one
    @Artyomich, I agree, the skill of a programmer is not to write code without errors, but to write such code that could work with any errors. - k0mar

4 answers 4

 $($this).animate( 

change to

 $(this).animate( 
  • replaced nothing happens jsfiddle.net/pZnWx/1 - Artyomich
  • I strongly doubt that you can fasten the animate to a similar attribute - zb '18
  • @eicto I tried without a dash, nothing happens, and what would you advise, a moto alternative to some kind of thread ...? - Artyomich
  • 2
    through css3 do and do not suffer. - zb '
  • it's not a dash, but what is the value of text-shadow. - zb '

Very well advised comrade @eicto to do on CSS .

You can implement it this way:

 #container_logo p { font-family: Verdana; font-size: 28px; text-align: center; text-shadow: #363535 1px 1px 1px; font-variant: small-caps; color: white; cursor: pointer; } #container_logo p:hover { text-shadow: #363535 3px 3px 3px; 

}

  • plus just for koment! - Artyomich

In my opinion, it's easier to animate on CSS: corrected your example on JSFiddle . Solutions for jQuery, as a rule, require connecting some jQuery plugin.

 #container_logo p { font-family: Verdana; font-size: 28px; text-align: center; transition: all 0.25s ease-in-out; -webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out; text-shadow: 1px 1px 1px rgba(54,53,53,1); font-variant: small-caps; color: white; cursor: pointer; } #container_logo p:hover { text-shadow: 10px 10px 10px rgba(54,53,53,1); } 
  • @Zhukov Roman thanks, this alternative suits me perfectly! - Artyomich

http://www.alexpeattie.com/projects/animate-textshadow/ There is a good plugin for this purpose.