Mon. - Fri. 9 am - 5 pm Support Policy
Remember me

External URL for the Dot/Onepage Menu(tips)

1 year 7 months ago #1

  • onelove234's Avatar
  • onelove234
  • Posts: 333
Hi,

I found this and thought it would save some time for people.

1° add a class to the one page menu item from gridbox
2° add this to the jquery console and replace what needs to be replaced :
- .onepage by your class
-li:nth-child(*) by the number of the position of themenu item
-www.google.com

jQuery("document").ready(function(){
jQuery('.onepage .menu li:nth-child(2) a').on('click', function(event){
event.preventDefault();
window.open('www.google.com', '_self');
});
});

3° Enjoy ;)

P.S : if you want it to open in a new window, remove the '_self' argument on the last line.

1 year 7 months ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 6298
Hello,

Perfectly!
We think this is useful to our users ;)

Regards,
Vyacheslav, Balbooa.com

1 year 7 months ago #3

  • onelove234's Avatar
  • onelove234
  • Posts: 333
My pleasure :)

11 months 6 days ago #4

  • Artur's Avatar
  • Artur
  • Posts: 39
Hello

Very simple method, I used on the site, however, there is a problem
the link opens in a new window with an error.

See for yourself
position of the menu 3 regulamin
toyota.realizacja.info/

How can I fix it

Have a nice day!

Regards,
Artur

11 months 6 days ago #5

  • Artem's Avatar
  • Artem
  • Posts: 8221
Hi,

Replace code in the JS editor form
window.open('www.google.com');

to
window.open('www.google.com', '_self');

Regards,
Artem, Balbooa.com

11 months 6 days ago #6

  • Artur's Avatar
  • Artur
  • Posts: 39
Hi Artem

Thank you very much,
the code must have a full link including http or https
it's working fine now.

Have a nice day!

Regards,
Artur

3 months 3 weeks ago #7

  • Tadeusz's Avatar
  • Tadeusz
  • Posts: 7
Can you describe what and where to add. As for a corpse.
How to explain it to an editor who does not know what js and css are.

3 months 3 weeks ago #8

  • Artem's Avatar
  • Artem
  • Posts: 8221
I will try :)

Step 1
Open your one page menu plugin settings and navigate to the field "class suffix" add onepage



Step 2
Open Gridbox JS editor



Step 3
To the JS editor place this code:
jQuery("document").ready(function(){
jQuery('.onepage .menu li:nth-child(2) a').on('click', function(event){
event.preventDefault();
window.open('www.google.com', '_self');
});
});

Where:
2 - This is the number of menu item by clicking on which the external link will open.
www.google.com - you need to replace at your URL

Let us know if you'll need more assistance

Regards,
Artem, Balbooa.com

3 months 3 weeks ago #9

  • Tadeusz's Avatar
  • Tadeusz
  • Posts: 7
Thank you very much. I hope that in the future it will be possible to add in the url form

3 months 3 weeks ago #10

  • Artem's Avatar
  • Artem
  • Posts: 8221
Your welcome! I think yes, we can consider this request.

Regards,
Artem, Balbooa.com
Powered by Kunena Forum