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 8923253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:04:21+00:00 2026-06-15T07:04:21+00:00

I want to create mobile like on/off button with extjs in my web application.

  • 0

I want to create mobile like on/off button with extjs in my web application. I couldn’t find any sample or solution for this. I want actually like this: Demo

CSS

/* 
    Created by @JohnieHjelm. I took the liberty of doing this ON/OFF switch
    just to express my love for CSS3. You're free to use this and of course
    I hoped you learned something. Sharing is Caring♥
*/

body{
    background:#eee;
}

ul{
    list-style:none;
    width:85px;
    height:26px;
    position:absolute;
    top:50%;
    left:50%;
    margin:-13px 0 0 -42px;
}

ul li{
    float:left;
    line-height:23px;
    font-size:11px;
    padding:2px 10px 0; 

    background: #E5E5E5;
    background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#F3F3F3), to(#E5E5E5));
    text-shadow:0 1px 0 #FFF;
    border-left:1px solid #D5D5D5;
    border-top:1px solid #D5D5D5;
    border-bottom:1px solid #D5D5D5;
    -webkit-box-shadow:0 1px 0 #FFF inset, 0 0 5px rgba(0, 0, 0, .1) inset, 0 1px 1px rgba(0, 0, 0, .3);
}

ul li:first-child{
    -webkit-border-radius:5px 0 0 5px;
}
ul li:last-child{
    -webkit-border-radius:0 5px 5px 0;
}

ul li a{
    text-decoration: none;
    font-family:Helvetica, Arial;
    text-transform:uppercase;
    color:#a1a1a1;
}

.on{
    background: #505050;
    background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#777), to(#505050));
    text-shadow:0 -1px 0 #444, 0 0 7px #9AE658;
    border-right:1px solid #444;
    border-top:1px solid #444;
    border-bottom:1px solid #444;
    -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, .7) inset, 0 1px 0 #FFF;  
}

ul li:not(.on):active{
    background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddd), to(#f1f1f1));
}


ul li.on a{
    color:#7BBA47;
    cursor: default;
}​

jQuery

$(function(){
    $("ul li").click(function(){
        $("ul li").removeClass("on");
        $(this).addClass("on"); 
    });
});​

How can I do this with ExtJS?

  • 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-15T07:04:22+00:00Added an answer on June 15, 2026 at 7:04 am

    Just a quick one which can easily extended to a full component:

    Ext.get(Ext.query("ul li")).on('click', function(e, t, eOpts) { 
        var el = Ext.get(this),p;
        el.addCls("on");
        if((p = el.next())) {
            p.removeCls("on");
            alert('can fire turn OFF');
        } else if ((p = el.prev())){
            p.removeCls("on");
            alert('can fire turn ON');
        }
    })​;​
    

    Here’s a JSFiddle

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

Sidebar

Related Questions

http://jquerymobile.com/test/docs/lists/lists-search.html I want to create a filter like this with jquery mobile without having
Like here: Automatic authentication for Android WiFi Direct I want to create a mobile
I want to create a mobile application and from a tutorial I have been
I want to create a json like this in java. { contacts: [ {
I have a web app of which I would like to create a mobile
If I want to create web site in android application by using eclipse 3.7
I want to create this effect in mobile safari. http://jqueryfordesigners.com/demo/header-slide.html I'm using iScroll 4.
I'm using jquery-mobile with Ruby On Rails. I want to create a button link
I want to create a mobile chat application in jquery-mobile/html5/css3 + phonegap(client) and possibly
I want to create an SDK like AdMob for Mobile has created and want

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.