SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    animate in jQuery with IE and FF

    I am tetsting the following statement in both FF and IE8 and it works just fine in FF but only sets the bottom border for the first p element in IE and it's not animated, it just sets it. I thought one of the advantages in jQuery was that it was supposed to be cross-browser compatible. Am I doing something incorrect here?

    I have tried all possible combinations of quote marks and also border-bottom, etc.

    $('p').animate({borderBottom: '13px solid #8f8f8f',borderRight: '3px solid #bfbfbf'}, 2000);

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The jQuery animate function only animates numerical unit values so it will not work properly with the value of '3px solid #8f8f8f'.

    If you want to animate color values then you can use the toggleClass function which is part of the jQuery UI:
    http://jqueryui.com/demos/toggleClass/

    good luck

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll head in that direction.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •