Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:29:08+00:00 2026-06-11T21:29:08+00:00

I am kinda new to web development, and I would like to create a

  • 0

I am kinda new to web development, and I would like to create a graphic button with a highlight pulsed effect, let me explain :

The button is built with 2 layers, the first is the default state always displayed, and the second layer is the highlighted state (white) displayed only when the button is clicked or touched (opacity of this layer is 1 when displayed, 0 when hidden).

My problem is that I would like the opacity of the highlight to go from 0 to 1 regardless the duration of the click or the touch event. The transition back to opacity 0 value should occur only when value 1 has been reached, that means that release events (mouseup or touchend) shouldn’t be triggered until the opacity of the hightlight layer has reached 1.

I am using Compass (scss) and jquery mobile with phonegap encapsulation.

I have coded a version which works, but doesn’t meet my goal :
The transition to highlighted state is stopped as soon as I release the button (for instance, if I make a very quick touch, even with a 0.2s transition on opacity, the highlighted state is not visible, though the touchend event is triggered… (the transition returns to 0 before reaching 1)…

The whole code maybe not so clean, but I am trying to learn 🙂

Any clue or advice is welcome!

the HTML code looks like this :

<div class=btn-test>
 <span>
  <a class=btn-a href=#>
  </a>
 </span>
</div

the SCSS looks like this :

@import "compass/reset";
@import "compass/css3";

.btn-test {

  span {
      @include background-image(image-url("foo.png"));
      background-position: 0px 0px;

      width: 72px;
      height: 70px;

      display: inline-block;
    }

  a {
      @include background-image(image-url("foo.png"));
      background-position: 0 71px;

      @include transition-property(opacity);
      @include transition-duration(0.2s);
      @include transition-timing-function(ease);  

      width: 72px;
      height: 70px;

      display: inline-block;

      -webkit-touch-callout: none !important; 
  }

  .btn-a {

    opacity: 0;
  }

  .btn-a:active {

    opacity: 1;
  }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:29:10+00:00Added an answer on June 11, 2026 at 9:29 pm

    What you want is an animation, not a simple transition. You get cross browser animation in compass 0.13 alpha with gem install compass --pre

    The solution would be to add keyframes for your different states :

    @import "compass/css3/animation";
    
    @include keyframes(flashButton){
      0%{
        opacity: 0;
      }
      50%{
        opacity: 1;
      }
      100% {
        opacity: 0;
      }
    }
    
    .animate-button {
      @include animate(flashButton 1s ease);
    }
    

    And then with a little bit of jQuery :

    $('.btn-test').on('click', function(){
      //reset state in case animation has already been played
      $('.btn-test').removeClass('animate-button');
      setTimeout(function(){$('.btn-test').addClass('animate-button')}, 1)
    });
    

    I didn’t use it yet but you can also use https://github.com/ericam/compass-animate which is a compass port of the great css animations found here http://daneden.me/animate/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am kinda new in web development, looking for secured way to update SQL
using Visual.Web.Developer.2010.Express; using SQL.Server.Management.Studio.2008.R2; Kinda new at C# here.. I got the first row
I'm kind of new in web development with Java. I am developing a web
Firstly, I should say I'm completely new to Pylons, trying to learn web development
I have started using Python for web development recently, it's kinda cool; I have
Having properly configured a Development server and a Production server, I would like to
I'm new to web development, I'm sure there's a simple answer to this, but
I'm very new to web development, so bear with me =) Ok here is
I'm new to web development. I have a login.aspx page that has an Asp.Net
I am new to web development, and I need advice about how to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.