- Posts: 9
COMMUNITY FORUM
K2 Modal Window
- Milan Sadil
- Topic Author
- Offline
- New Member
Less
More
5 years 7 months ago #171704
by Milan Sadil
K2 Modal Window was created by Milan Sadil
item.php override contains the following code:
<script type="text/javascript">
window.addEvent('domready', function(){
SqueezeBox.assign($$('a.k2Modal'), {
parse: 'rel'
});
});
</script>
When a page containing the code is opened in a browser the following error is generated:
Uncaught TypeError: window.addEvent is not a function
Perhaps it is a matter of using an obsolete MooTools function (I just upgraded to K2 2.9.0 and Joomla 3.9.5), but I have no idea what to use instead of this. Can you direct me the right way?
<script type="text/javascript">
window.addEvent('domready', function(){
SqueezeBox.assign($$('a.k2Modal'), {
parse: 'rel'
});
});
</script>
When a page containing the code is opened in a browser the following error is generated:
Uncaught TypeError: window.addEvent is not a function
Perhaps it is a matter of using an obsolete MooTools function (I just upgraded to K2 2.9.0 and Joomla 3.9.5), but I have no idea what to use instead of this. Can you direct me the right way?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Away
- Admin
Less
More
- Posts: 6218
5 years 7 months ago #171751
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 Modal Window
Just remove that part and make sure you add data-k2-modal="image" to the <a> element wrapping your main K2 item image (so you still have a working lightbox/modal to the XL image).
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Milan Sadil
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
5 years 3 months ago #172721
by Milan Sadil
Replied by Milan Sadil on topic K2 Modal Window
Can you please advice where I can 'add data-k2-modal="image" to the <a> element wrapping your main K2 item image' - so it is applied to every article (K2 item)?
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Away
- Admin
Less
More
- Posts: 6218
5 years 3 months ago #172730
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic K2 Modal Window
This line: github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php#L198
In any case, always compare your template overrides with the source overrides in /components/com_k2/templates/.
In any case, always compare your template overrides with the source overrides in /components/com_k2/templates/.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.