logo
down
shadow

how to add active class in framework nav menu when (add/edit) pages are opened


how to add active class in framework nav menu when (add/edit) pages are opened

By : Lahiru Muthumal
Date : November 24 2020, 03:01 PM
With these it helps I am using phalcon framework. I want to active parent menu when children are opened in the framework terminology,
code :
<?=$c['route']==$this->router->getControllerName()."/".$this->router->getActionName() 
|| $c['route']==$this->router->getControllerName().$this->router->getActionName()  
|| $c['route']==$this->router->getControllerName()?" open_me":""?> ">
/users/                 == users/adduser            || usersadduser             || users
/craigslist/campaigns   == craigslist/addcampaign   || craigslistaddcampaign    || craigslist                           


Share : facebook icon twitter icon
Zend Framework double class menu active

Zend Framework double class menu active


By : Alec_Yu
Date : March 29 2020, 07:55 AM
I hope this helps you . I make a menu with Zend_Navigation. The trouble is that I detect a few times "active menu" that is, the "li" of the current page. , My solution
change your Bootrasp.php:
code :
public function _initNavigation()
{
    $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
    $navigation = new Zend_Navigation($config);
    Zend_Registry::set('Zend_Navigation', $navigation);
}
<?=$this->navigation()->menu()->renderPartial(null, 'shared/menu.phtml')?>
<ul class="navigation">
    <?
    foreach ($this->container as $page) :
    /** @var $page Zend_Navigation_Page_Mvc */
    ?>
        <li class="<?=$page->isActive(true) ? 'active' : ''?>">
            <a href="<?=$page->getHref()?>"><b><?=$page->label?></b></a>
        </li>
    <? endforeach; ?>
</ul>
How do i active last opened tab that open by click on menu item on menu bar?

How do i active last opened tab that open by click on menu item on menu bar?


By : Евгений Галицкий
Date : March 29 2020, 07:55 AM
I hope this helps you . I create a web application. Here I use prime-face tab and ajax. when I click on menu item on menu bar it open a new tab. but active the first opened tab. I want to active the last opened tab. my code here: , You add flowing command in jsf page:
code :
  <p:tabView id="outputTab" activeIndex="#{ajaxBean.count}">
  @ManagedBean(name = "ajaxBean")
  @SessionScoped
  public class AjaxBean implements Serializable {

  public AjaxBean() {
  }
  private boolean input;
  private List<String> chcekItem = new ArrayList<String>();
  private int count;

  public void setAction(String action) {
  input = true;
  if (getChcekItem().isEmpty()) {
    count++;
    getChcekItem().add(action);
    System.out.println("The item " + action + " is Successfully Added to array");
  } else {

    for (String abce : getChcekItem()) {
        if (abce.equals(action)) {
            System.out.println(abce + "=" + action);
            input = false;
            //We can jump out of the loop here since we already found a matching value
            break;
        }
    }

    if (input) {
        count++;
        getChcekItem().add(action);
        System.out.println("The item " + action + " is Successfully Added to array");
    } else {
        System.out.println("The item " + action + " is Exist");
    }
    }


   }
    private String close;

   public void closeTab(TabCloseEvent closeAction) {
  close = closeAction.getTab().getId();
  for (String abce : getChcekItem()) {
    if (abce.equals(close)) {
        count--;
        System.out.println(close + " is remove from Array");
        getChcekItem().remove(abce);

        //We can jump out of the loop here since we already found a matching value
        break;
      }
      }  
      }

     public String editAction() {
           return null;
                    }


        public List<String> getChcekItem() {
           return chcekItem;
           }


       public void setChcekItem(ArrayList<String> chcekItem) {
           this.chcekItem = chcekItem;
          }


       public boolean isInput() {
            return input;
          }

       public void setInput(boolean input) {
                this.input = input;
         }

       public int getCount() {
           return count-1;
        }


      public void setCount(int count) {
       this.count = count;
      }

     }
When I opened Edit friends from menu, Application stopped

When I opened Edit friends from menu, Application stopped


By : wisp
Date : March 29 2020, 07:55 AM
I hope this helps you . mUsers is never initialized. Thus, users is also null and users.size() is likely causing the NullPointerException in done(). Check that mUsers or users isn't null there.
WordPress - Adding .active class to active menu item's sub pages?

WordPress - Adding .active class to active menu item's sub pages?


By : user5014139
Date : March 29 2020, 07:55 AM
Hope that helps There is a problem in wp_nav_menu below: , Try changing the block you pasted from your functions.php file from:
code :
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
    if( in_array('current-menu-item', $classes) ){
        $classes[] = 'active ';
    }
    return $classes;
}
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
    if( in_array('current_page_parent', $classes) ){
        $classes[] = 'active ';
    }
return $classes;
}
Active menu on scroll removing class in other pages

Active menu on scroll removing class in other pages


By : Greg
Date : March 29 2020, 07:55 AM
wish of those help Im doing a website through WordPress. I implemented active menu on scroll following this post, because of this. , Ok I've changed
code :
menuItems = topMenu.find('a[href*="#"]')
Related Posts Related Posts :
  • Make web service not accessible by browser?
  • Select DOM elements within template
  • How to customize angular ui-grid row background color?
  • Binding data in two respective $scope in AngularJS, how?
  • react put some props after import class
  • Variable is distributed among same components
  • switch class in jQuery/JavaScript for active/inactive state
  • How To Track Outbound Clicks Using Javascript
  • How to get total seconds elapsed since the beginning of the month?
  • Protractor: Stale element reference at "browser.wait(EC.visibilityOf(confDial), FIFTY_SECONDS);"
  • Access to an array inside an object
  • Reseting an JavaScript Interval with different value?
  • Learning Angular for the first time - version 2 or 4?
  • Rendering RSS feed (XML) in React with jquery, why do object values parsed from the feed seem empty?
  • Node.js xml2js http.request tag matching
  • applying texture to custom plane geometry in Threejs
  • How do I pass an Event as a function parameter in HTML written inside JavaScript variable?
  • Interface of object parameter with default value and default property
  • Does using try / catch rather than `.catch` observable operator with XHR requests reduce performance?
  • In IE11 background colors not working on printing
  • TypeScript interface signature "(): string"
  • Is synchronous XMLHttpRequest supported in Internet Explorer 10 and 11?
  • Axios function not returning any values with js
  • How to use firestore TIMESTAMP to create time-stamp in JavaScript
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org