Mobile Column Order & Sticky Column

Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Trigger a lightbox popup form

4 years 2 months ago #1

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
Hi guys, i was wondering how could i trigger a lightbox popup form from a menu item thanks!

4 years 2 months ago #2

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

You need form popup link into page, using Developer tool get data-popup


add menu item with Link CSS Style : forms-trigger

and at the your themplate custom JS file add code:
jQuery(document).ready(function(){
	jQuery(".forms-trigger").on('click', function(){
    	jQuery('[data-popup="popup-form-30"]').trigger('click');
    })
})

form link you can hide using custom css and display: none;

Regards,
Vyacheslav, Balbooa.com

4 years 2 months ago #3

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
Thanks for your reply, but i think i missing something here:

"add menu item with Link CSS Style : forms-trigger"

i added the link css style but which url do i have to enter? just "#" right?

and i entered

<script>jQuery(document).ready(function(){
jQuery(".forms-trigger").on('click', function(){
jQuery('[data-popup="popup-form-1"]').trigger('click');
})
})</script>

(popup-form-1 is for me) in the Before </body> gantry framework without any result, thanks in advance.

4 years 2 months ago #4

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
ok, i've achieved it by enabling a module with the form call and it works but it has two problems:

1) adding just a # to the link: i'm designing a one page site, so if you're looking any part of it, it goes directly to the top, i just want the screen to be right there where the user is looking at when the user click the contact menu link, removing the # (leaving the url blank) opens the popup but it reloads the page.

2) i need the form module to be published but hidden

thanks again

4 years 2 months ago #5

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
i've achieved it by entering # to the url and adding the custom before </body> in the template:

<script>
$("a").click(function(event) {
event.preventDefault();
});
</script>

now it works, now i need to hide the entire module

4 years 2 months ago #6

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

you need add custom class(example-class) for your module and add css code:
.example-class {
     display: none;
}

Regards,
Vyacheslav, Balbooa.com

4 years 2 months ago #7

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
Sorry i've found out a problem

4 years 2 months ago #8

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
adding the code:

<script>
$("a").click(function(event) {
event.preventDefault();
});
</script>

while it fixes the screen coming back to the top, it prevents the other menu links from working.

Do you have another solution to avoid the link to return to the top and let the rest of the menu items work?

4 years 2 months ago #9

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 15437
You're welcome :)

As I can see you are building 1 page website, I recommend you to try Gridbox, you will be really surprised how fast and easy you can build 1 page website.

Here is a short video how to configure 1 page menu with Gridbox Joomla Website Builder

4 years 2 months ago #10

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
Sorry i've found out a problem

adding the code:

<script>
$("a").click(function(event) {
event.preventDefault();
});
</script>

while it fixes the screen coming back to the top, it prevents the other menu links from working.

Do you have another solution to avoid the link to return to the top and let the rest of the menu items work?

4 years 2 months ago #11

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 15437
Your code abolished the standard click event on all links,
use this code
<script>
$(".forms-trigger").click(function(event) {
event.preventDefault();
});
</script>

Regards,
Vyacheslav, Balbooa.com

4 years 2 months ago #12

  • Rodrigo's Avatar
  • Rodrigo
  • Posts: 93
Fantastic Vyacheslav, that solved the problem.

About Gridbox, sure i'll give a try in the future. Many thanks

4 years 2 months ago #13

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 15437
You are welcome! ;)
Powered by Kunena Forum