Attention: The Marketo Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.
Hi everyone,
I was trying to manipulate the lightbox form - form2.js - css position, the top, left attributes when it is displayed. We have a button in the middle of the page - height,width position - , and when we click on it, the lightbox form is displayed on the top position of the page so the page jumped to the top of it cause it is quite long. How can I change this behaviour so when I click on the button the displayed form is shown in the same position as the button. What I need basically is to manipulate the top, left and position css attributes of the form dialog. Is it possible?
MktoForms2.whenReady(function(form){if(typeof(MktoForms2.defaultForm)=='undefined')MktoForms2.defaultForm=form;});
[...] $('.linkbutton').click(function(){ var formId = $(this).attr('data-form'); var f = formId > 1000 ? MktoForms2.getForm(formId): MktoForms2.defaultForm; MktoForms2.lightbox(f).show(); }); [...]
Hope you understand me. Thanks in advance for your help.
Regards,
David
Solved! Go to Solution.
I wonder if you need the native lightbox at all? If you want the button to be visually aligned with the form, maybe have the form just draw next to the button (demo at https://cdpn.io/figureone/debug/3e8aabf97879b8b432f13d113e34313f😞
Hey David, can you share a link to an example of this on a live page somewhere?
Hi Dave,
sorry, I didn't have any online code so far. Thank you for your help too. 😉
I wonder if you need the native lightbox at all? If you want the button to be visually aligned with the form, maybe have the form just draw next to the button (demo at https://cdpn.io/figureone/debug/3e8aabf97879b8b432f13d113e34313f😞
Hi Sandford,
that helped me to achieve what I was looking for and solve my problems. Probably next time we do not try to use a lightbox form for this case as you suggested.
Thank you for you example and help!!
David