Skip to content

andrewesteves/urlActive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

urlActive() jQuery plugin

jQuery plugin to add a style to the link id according to url

The usage:

Important in your html the href must be the entire link like http://andrewesteves.com.br/, the menu id is #menu and the css style is .active

Need to create a class named .active and set an id named #menu in your stylesheet to get default value


$("#menu a").urlActive();

To set your own style class just pass the parameter myClass


$("#menu a").urlActive({
  'myClass' : 'myNameClass'
});

To set your own id parameter myId


$("#myIdName a").urlActive({
  'myId' : '#myIdName'
});

Português

Plugin jQuery para adicionar um estilo para o ID do link de acordo com a url.

O uso:

Importante em sua html a href deve ser todo o link como http://andrewesteves.com.br/, o id do menu é #menu e o css style é. active

Necessidade de criar uma classe chamada .active em sua folha de estilo para obter o valor default


$ ("#menu a").urlActive();

Para definir sua própria classe de estilo basta passar o parâmetro myClass


$ ("#menu a").urlActive ({
   'myClass': 'myNameClass'
});

Para definir seu próprio id de estilo basta passar o parâmetro myId


$("#myIdName a").urlActive({
  'myId' : '#myIdName'
});

About

jQuery plugin to add a style to the link id according to url

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors