Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Amit Sukapure

    (@amitsukapure)

    Definitely, But you need to write some custom code using jQuery.
    Something like,

    jQuery('#mylist li').click(function(){
    	jQuery('#mylist li').removeClass('active'); //first remove all active class from list
    	jQuery(this).addClass('active'); //add active class to current item
    });

    In your css,
    .active > ul { display:block }

    Thread Starter scevola

    (@scevola)

    thanks for your work and your answer.
    I just do something similar but it doesnt want work.
    I created a js file with the code you suggested and i called it in the header of wp

    <script type=”text/javascript” src=”………/attivalink.js”></script>

    . i modified style.css and nothing appen .

    mylist

    is the name of the menu that i created and putted in shortcode or somethingelse? thank u in advance

    Plugin Author Amit Sukapure

    (@amitsukapure)

    Thanks,

    Here I’ve set up fiddle for you, https://jsfiddle.net/amitsukapure/h3z86/

    Just add custom id or class for your list from shortcode menu.

    Thread Starter scevola

    (@scevola)

    thank u very much , i’ll try later

    Thread Starter scevola

    (@scevola)

    sorry , can u help me ? my code is https://jsfiddle.net/H34LA/1/
    I’m stuck

    Thread Starter scevola

    (@scevola)

    ok i mistuke something but now it’s working thank u very much .
    this is my solution i hope it can help someone ??

    https://jsfiddle.net/H34LA/4/

    Thread Starter scevola

    (@scevola)

    sorry again. with your plugin it works just for a while, after one second it desappear because (i think) shortmenu is inside the post that is refreshed when i click on the link. there is a solution? i put the code in the footer of WP

    Plugin Author Amit Sukapure

    (@amitsukapure)

    Yes will be, as li>a having urls. My plugin will just using WordPress’s function to build menu. And it retrieves menu items with respective urls.
    You need to customized your menu as per your requirement,
    – Remove urls from href attribute of parent li
    – use on click of parent li event .menu > li
    – do not use # in href, use javascript:void(0)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘isit possible to set active’ is closed to new replies.